Skip to content

Commit

Permalink
Merge pull request #102 from geoadmin/no_https_port_specified_when_de…
Browse files Browse the repository at this point in the history
…fault_helps_avoid_redirection_when_csw_get_records_auto-deploy

Remove :443 port in CSW
  • Loading branch information
fgravin authored Jan 29, 2018
2 parents 0d3ac5f + b5407aa commit ee39b90
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,12 @@ private void substitute(ServiceContext context, Element capab, CswCapabilitiesIn
vars.put("$PROTOCOL", sm.getValue(Settings.SYSTEM_SERVER_PROTOCOL));
vars.put("$HOST", sm.getValue(Settings.SYSTEM_SERVER_HOST));
String port = sm.getValue(Settings.SYSTEM_SERVER_PORT);
vars.put("$PORT", "80".equals(port) ? "" : ":" + port);

boolean hasToLetPortEmpty =
("80".equals(port) && "http".equals(sm.getValue(Settings.SYSTEM_SERVER_PROTOCOL))) ||
("443".equals(port) && "https".equals(sm.getValue(Settings.SYSTEM_SERVER_PROTOCOL)));

vars.put("$PORT", hasToLetPortEmpty ? "" : ":" + port);
vars.put("$END-POINT", context.getService());
vars.put("$NODE_ID", context.getNodeId());

Expand Down

0 comments on commit ee39b90

Please sign in to comment.