tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/aaa AccessInterceptor.java
Date Sun, 21 Nov 2004 02:47:01 GMT
billbarker    2004/11/20 18:47:01

  Modified:    src/share/org/apache/tomcat/modules/aaa
                        AccessInterceptor.java
  Log:
  Process the redirect to https if the redirectPort is specified
  
  Revision  Changes    Path
  1.23      +15 -0     jakarta-tomcat/src/share/org/apache/tomcat/modules/aaa/AccessInterceptor.java
  
  Index: AccessInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/aaa/AccessInterceptor.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- AccessInterceptor.java	25 Feb 2004 06:52:40 -0000	1.22
  +++ AccessInterceptor.java	21 Nov 2004 02:47:01 -0000	1.23
  @@ -305,6 +305,21 @@
   	if( "CONFIDENTIAL".equalsIgnoreCase(transp) || 
   	    "INTEGRAL".equalsIgnoreCase(transp) ) {
   	    if( ! req.scheme().equals("https")) {
  +		Integer rp = (Integer)req.getAttribute("org.apache.tomcat.request.redirectPort");
  +		if(rp != null && rp.intValue() > 0) {
  +		    StringBuffer rsb = new StringBuffer();
  +		    rsb.append("https://").append(req.serverName());
  +		    if(rp.intValue() != 443) {
  +			rsb.append(':').append(rp);
  +		    }
  +		    rsb.append(req.requestURI());
  +		    if(!req.query().isNull()) {
  +			rsb.append('?').append(req.query());
  +		    }
  +		    req.setAttribute("javax.servlet.error.message",
  +		    		     rsb.toString());
  +		    return 301;
  +		}
   		// We could redirect or do something advanced - but the spec
   		// only requires us to deny access. A nice error handler
   		// would also be nice
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message