diff --git a/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java b/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java
index 55bfd1ac31..5bfa196d01 100644
--- a/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java
+++ b/framework/webapp/src/org/ofbiz/webapp/website/WebSiteProperties.java
@@ -34,6 +34,7 @@ import org.ofbiz.entity.GenericValue;
@ThreadSafe
public final class WebSiteProperties {
+
/**
* Returns a WebSiteProperties instance initialized to the settings found
* in the url.properties file.
@@ -88,13 +89,13 @@ public final class WebSiteProperties {
if (httpPort.isEmpty() && !request.isSecure()) {
httpPort = String.valueOf(request.getServerPort());
}
- if (httpHost.isEmpty() && !request.isSecure()) {
+ if (httpHost.isEmpty()) {
httpHost = request.getServerName();
}
if (httpsPort.isEmpty() && request.isSecure()) {
httpsPort = String.valueOf(request.getServerPort());
}
- if (httpsHost.isEmpty() && request.isSecure()) {
+ if (httpsHost.isEmpty()) {
httpsHost = request.getServerName();
}
webSiteProps = new WebSiteProperties(httpPort, httpHost, httpsPort, httpsHost, enableHttps);
@@ -179,4 +180,15 @@ public final class WebSiteProperties {
public boolean getEnableHttps() {
return enableHttps;
}
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("{httpPort=");
+ sb.append(httpPort).append(", ");
+ sb.append("httpHost=").append(httpHost).append(", ");
+ sb.append("httpsPort=").append(httpsPort).append(", ");
+ sb.append("httpsHost=").append(httpsHost).append(", ");
+ sb.append("enableHttps=").append(enableHttps).append("}");
+ return sb.toString();
+ }
}