billbarker    2003/03/23 00:57:49

  Modified:    coyote/src/java/org/apache/coyote Request.java
               coyote/src/java/org/apache/coyote/tomcat4 CoyoteAdapter.java
               coyote/src/java/org/apache/coyote/tomcat5 CoyoteAdapter.java
  Log:
  Fix problem where the scheme doesn't default to the connector.
  
  Reported By: Randy Watler <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.20      +1 -1      
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- Request.java      5 Mar 2003 02:31:47 -0000       1.19
  +++ Request.java      23 Mar 2003 08:57:48 -0000      1.20
  @@ -518,7 +518,7 @@
        //remoteHostMB.recycle();
   
        // XXX Do we need such defaults ?
  -        schemeMB.setString("http");
  +        schemeMB.recycle();
        methodMB.setString("GET");
           uriMB.setString("/");
           queryMB.setString("");
  
  
  
  1.18      +18 -5     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat4/CoyoteAdapter.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- CoyoteAdapter.java        16 Mar 2003 01:57:57 -0000      1.17
  +++ CoyoteAdapter.java        23 Mar 2003 08:57:49 -0000      1.18
  @@ -218,7 +218,20 @@
           throws IOException {
           // XXX the processor needs to set a correct scheme and port prior to this 
point, 
           // in ajp13 protocols dont make sense to get the port from the connector..
  -        request.setSecure(req.scheme().equals("https"));
  +        // XXX the processor may have set a correct scheme and port prior to this 
point, 
  +        // in ajp13 protocols dont make sense to get the port from the connector...
  +        // otherwise, use connector configuration
  +        if (! req.scheme().isNull()) {
  +            // use processor specified scheme to determine secure state
  +            request.setSecure(req.scheme().equals("https"));
  +        } else {
  +            // use connector scheme and secure configuration, (defaults to
  +            // "http" and false respectively)
  +            req.scheme().setString(connector.getScheme());
  +            request.setSecure(connector.getSecure());
  +        }
  + 
  +
   
           request.setAuthorization
               (req.getHeader(Constants.AUTHORIZATION_HEADER));
  
  
  
  1.17      +17 -5     
jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteAdapter.java
  
  Index: CoyoteAdapter.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteAdapter.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- CoyoteAdapter.java        16 Mar 2003 01:58:58 -0000      1.16
  +++ CoyoteAdapter.java        23 Mar 2003 08:57:49 -0000      1.17
  @@ -221,7 +221,19 @@
           throws Exception {
           // XXX the processor needs to set a correct scheme and port prior to this 
point, 
           // in ajp13 protocols dont make sense to get the port from the connector..
  -        request.setSecure(req.scheme().equals("https"));
  +        // XXX the processor may have set a correct scheme and port prior to this 
point, 
  +        // in ajp13 protocols dont make sense to get the port from the connector...
  +        // otherwise, use connector configuration
  +        if (! req.scheme().isNull()) {
  +            // use processor specified scheme to determine secure state
  +            request.setSecure(req.scheme().equals("https"));
  +        } else {
  +            // use connector scheme and secure configuration, (defaults to
  +            // "http" and false respectively)
  +            req.scheme().setString(connector.getScheme());
  +            request.setSecure(connector.getSecure());
  +        }
  + 
   
           // FIXME: the code below doesnt belongs to here, this is only  have sense 
           // in Http11, not in ajp13..
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to