Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 406554 - URI Unqualification fails for HTTPS
fixed JsonURIUnqualificationStrategy to support
default ports for HTTP (port 80) and HTTPS (port 443)

Change-Id: Ief0922e857ce5d1837760823107214796c070319
Signed-off-by: Michael Ochmann <michael.ochmann@sap.com>
  • Loading branch information
Michael Ochmann committed Apr 25, 2013
1 parent 4b51661 commit 7672ba1
Showing 1 changed file with 11 additions and 1 deletion.
Expand Up @@ -128,7 +128,7 @@ protected static URI unqualifyURI(URI uri, String scheme, String hostname, int p
URI simpleURI = uri;
int uriPort = uri.getPort();
if (uriPort == -1) {
uriPort = 80;
uriPort = getDefaultPort(uri.getScheme());
}
if (scheme.equals(uri.getScheme()) && hostname.equals(uri.getHost()) && port == uriPort) {
try {
Expand All @@ -139,4 +139,14 @@ protected static URI unqualifyURI(URI uri, String scheme, String hostname, int p
}
return simpleURI;
}

private static int getDefaultPort(String scheme) {
if ("http".equalsIgnoreCase(scheme)) {
return 80;
}
if ("https".equalsIgnoreCase(scheme)) {
return 443;
}
return -1;
}
}

0 comments on commit 7672ba1

Please sign in to comment.