Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2013-04-05 01:35:37 -0400
committerGreg Wilkins2013-04-05 01:35:37 -0400
commitabcb4f163b7a21f0cb5949a49eb6409310797b52 (patch)
tree78c915ffc011846f0154aeffb8060e817c6c9d33 /jetty-security/src/main/java
parent6b3cb20720c12e83845a0fe8fa347376f240a9f2 (diff)
parentcada28e8cfc0d5b561829296977af8b29b84ad48 (diff)
downloadorg.eclipse.jetty.project-abcb4f163b7a21f0cb5949a49eb6409310797b52.tar.gz
org.eclipse.jetty.project-abcb4f163b7a21f0cb5949a49eb6409310797b52.tar.xz
org.eclipse.jetty.project-abcb4f163b7a21f0cb5949a49eb6409310797b52.zip
Merge remote-tracking branch 'origin/jetty-7' into jetty-8
Conflicts: jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
Diffstat (limited to 'jetty-security/src/main/java')
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
index 33318af13c..c1f147a4c2 100644
--- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
+++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java
@@ -31,6 +31,7 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
+import org.eclipse.jetty.http.HttpSchemes;
import javax.servlet.HttpConstraintElement;
import javax.servlet.HttpMethodConstraintElement;
import javax.servlet.ServletSecurityElement;
@@ -704,7 +705,11 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
return true;
if (connector.getIntegralPort() > 0)
{
- String url = connector.getIntegralScheme() + "://" + request.getServerName() + ":" + connector.getIntegralPort() + request.getRequestURI();
+ String scheme=connector.getIntegralScheme();
+ int port=connector.getIntegralPort();
+ String url = (HttpSchemes.HTTPS.equalsIgnoreCase(scheme) && port==443)
+ ? "https://"+request.getServerName()+request.getRequestURI()
+ : scheme + "://" + request.getServerName() + ":" + port + request.getRequestURI();
if (request.getQueryString() != null)
url += "?" + request.getQueryString();
response.setContentLength(0);
@@ -723,11 +728,13 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
if (connector.getConfidentialPort() > 0)
{
- String url = connector.getConfidentialScheme() + "://" + request.getServerName() + ":" + connector.getConfidentialPort()
- + request.getRequestURI();
+ String scheme=connector.getConfidentialScheme();
+ int port=connector.getConfidentialPort();
+ String url = (HttpSchemes.HTTPS.equalsIgnoreCase(scheme) && port==443)
+ ? "https://"+request.getServerName()+request.getRequestURI()
+ : scheme + "://" + request.getServerName() + ":" + port + request.getRequestURI();
if (request.getQueryString() != null)
url += "?" + request.getQueryString();
-
response.setContentLength(0);
response.sendRedirect(url);
}

Back to the top