Changeset 32433 for main/trunk

Show
Ignore:
Timestamp:
07.09.2018 19:54:41 (13 months ago)
Author:
ak19
Message:

Oversight. If httpPort is 80, don't append colon and 80 to form base URL.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java

    r32432 r32433  
    224224            String httpPort = properties.getProperty("localhost.port.http"); 
    225225            localhost_http_web_address = properties.getProperty("localhost.protocol.http") + "://" 
    226                 + properties.getProperty("localhost.server.http", "127.0.0.1") // likely to be 127.0.0.1 rather than localhost, since localhost can be modified and is therefore unsafe 
    227                 + httpPort; 
    228  
    229  
     226                + properties.getProperty("localhost.server.http", "127.0.0.1"); // 127.0.0.1 better as fallback rather than localhost, since localhost can be modified and is therefore unsafe 
     227            if(httpPort != null && !httpPort.equals("") && !httpPort.equals("80")) { // no need to check 443, *http*Port can't be 443 
     228                localhost_http_web_address = localhost_http_web_address + ":" + httpPort; 
     229            } 
    230230 
    231231            // set the http and https variants of the full web address, if they're meant to be available