Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2013-04-05 01:32:51 -0400
committerGreg Wilkins2013-04-05 01:32:51 -0400
commitcada28e8cfc0d5b561829296977af8b29b84ad48 (patch)
tree1f6ee6893b3b17e98008a588cd4c2a7055375a32 /jetty-security/src/main/java
parentb58066451e08b540d03d43498a293706142085d8 (diff)
downloadorg.eclipse.jetty.project-cada28e8cfc0d5b561829296977af8b29b84ad48.tar.gz
org.eclipse.jetty.project-cada28e8cfc0d5b561829296977af8b29b84ad48.tar.xz
org.eclipse.jetty.project-cada28e8cfc0d5b561829296977af8b29b84ad48.zip
404325 data constraint redirection does send default port
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 8132aae67d..a7515cc274 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
@@ -29,6 +29,7 @@ import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
+import org.eclipse.jetty.http.HttpSchemes;
import org.eclipse.jetty.http.PathMap;
import org.eclipse.jetty.server.AbstractHttpConnection;
import org.eclipse.jetty.server.Connector;
@@ -365,7 +366,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);
@@ -384,11 +389,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