Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2014-07-03 02:01:37 -0400
committerGreg Wilkins2014-07-03 02:01:37 -0400
commit706fe1eba3474dcfca9de51b35f2d100ef43d3bc (patch)
tree93b653732d35bdb1f2ba9d30a24d52bd041b4aef /jetty-security/src/main/java/org/eclipse
parentc8ee504291a6f1079039fa606e8ded6bd0fd7444 (diff)
parent0f70f28839b62d16fd3ad8612e6675180c97bbba (diff)
downloadorg.eclipse.jetty.project-706fe1eba3474dcfca9de51b35f2d100ef43d3bc.tar.gz
org.eclipse.jetty.project-706fe1eba3474dcfca9de51b35f2d100ef43d3bc.tar.xz
org.eclipse.jetty.project-706fe1eba3474dcfca9de51b35f2d100ef43d3bc.zip
Merge remote-tracking branch 'origin/master' into jetty-http2
Diffstat (limited to 'jetty-security/src/main/java/org/eclipse')
-rw-r--r--jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java10
1 files changed, 4 insertions, 6 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 201618d89d..1bd2d52cd1 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
@@ -46,6 +46,7 @@ import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
import org.eclipse.jetty.server.UserIdentity;
import org.eclipse.jetty.server.handler.ContextHandler;
+import org.eclipse.jetty.util.URIUtil;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.util.security.Constraint;
@@ -627,7 +628,7 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
@Override
protected RoleInfo prepareConstraintInfo(String pathInContext, Request request)
{
- Map<String, RoleInfo> mappings = (Map<String, RoleInfo>)_constraintMap.match(pathInContext);
+ Map<String, RoleInfo> mappings = _constraintMap.match(pathInContext);
if (mappings != null)
{
@@ -700,11 +701,8 @@ public class ConstraintSecurityHandler extends SecurityHandler implements Constr
{
String scheme = httpConfig.getSecureScheme();
int port = httpConfig.getSecurePort();
- String url = ("https".equalsIgnoreCase(scheme) && port==443)
- ? "https://"+request.getServerName()+request.getRequestURI()
- : scheme + "://" + request.getServerName() + ":" + port + request.getRequestURI();
- if (request.getQueryString() != null)
- url += "?" + request.getQueryString();
+
+ String url = URIUtil.newURI(scheme, request.getServerName(), port,request.getRequestURI(),request.getQueryString());
response.setContentLength(0);
response.sendRedirect(url);
}

Back to the top