forked from Qortal/qortal
Domain mapping now uses registered name instead of transaction signature.
There's no real need to maintain support for signature mapping anymore. Using this new method means that the latest version of a site is always served via the traditional domain name, whereas using transaction signatures caused older versions to be shown. Example settings.json configuration: "domainMapServiceEnabled": true, "domainMapServicePort": 80, "domainMap": [ { "domain": "webdemo.qortal.uk", "name": "QortalDemo" }, { "domain": "www.reqorder.org", "name": "ReQorder" } ]
This commit is contained in:
parent
3ad0e92a0f
commit
0328007345
@ -215,7 +215,7 @@ public class WebsiteResource {
|
||||
private HttpServletResponse getDomainMap(String inPath) {
|
||||
Map<String, String> domainMap = Settings.getInstance().getSimpleDomainMap();
|
||||
if (domainMap != null && domainMap.containsKey(request.getServerName())) {
|
||||
return this.get(domainMap.get(request.getServerName()), ResourceIdType.SIGNATURE, inPath, null, "", false);
|
||||
return this.get(domainMap.get(request.getServerName()), ResourceIdType.NAME, inPath, null, "", false);
|
||||
}
|
||||
return this.getResponse(404, "Error 404: File Not Found");
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ public class Settings {
|
||||
// Domain mapping
|
||||
public static class DomainMap {
|
||||
private String domain;
|
||||
private String signature;
|
||||
private String name;
|
||||
|
||||
private DomainMap() { // makes JAXB happy; will never be invoked
|
||||
}
|
||||
@ -283,12 +283,12 @@ public class Settings {
|
||||
this.domain = domain;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setSignature(String signature) {
|
||||
this.signature = signature;
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -511,7 +511,7 @@ public class Settings {
|
||||
public Map<String, String> getSimpleDomainMap() {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
for (DomainMap dMap : this.domainMap) {
|
||||
map.put(dMap.getDomain(), dMap.getSignature());
|
||||
map.put(dMap.getDomain(), dMap.getName());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user