summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMichael Ochmann2013-02-08 04:17:49 (EST)
committer skaegi2013-06-17 14:18:29 (EDT)
commit97e854d8c2ddb8fefde9f4fb6e5d730fc6e3e388 (patch)
tree1fccabc00662844694186c14fd3892ed4791bfdc
parent3ab47f43d20c6adb1ab1b24fd9782c23febc693c (diff)
downloadorg.eclipse.orion.server-97e854d8c2ddb8fefde9f4fb6e5d730fc6e3e388.zip
org.eclipse.orion.server-97e854d8c2ddb8fefde9f4fb6e5d730fc6e3e388.tar.gz
org.eclipse.orion.server-97e854d8c2ddb8fefde9f4fb6e5d730fc6e3e388.tar.bz2
Bug 406554 - URI Unqualification fails for HTTPSv20130617-1818
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>
-rw-r--r--bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/server/servlets/JsonURIUnqualificationStrategy.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/server/servlets/JsonURIUnqualificationStrategy.java b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/server/servlets/JsonURIUnqualificationStrategy.java
index 07f2cf2..33185f8 100644
--- a/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/server/servlets/JsonURIUnqualificationStrategy.java
+++ b/bundles/org.eclipse.orion.server.servlets/src/org/eclipse/orion/server/servlets/JsonURIUnqualificationStrategy.java
@@ -128,7 +128,7 @@ public abstract class JsonURIUnqualificationStrategy {
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 {
@@ -139,4 +139,14 @@ public abstract class JsonURIUnqualificationStrategy {
}
return simpleURI;
}
+
+ private static int getDefaultPort(String scheme) {
+ if ("http".equalsIgnoreCase(scheme)) {
+ return 80;
+ }
+ if ("https".equalsIgnoreCase(scheme)) {
+ return 443;
+ }
+ return -1;
+ }
}