remm        01/06/17 23:22:32

  Modified:    catalina/src/share/org/apache/catalina/connector/http
                        HttpProcessor.java
  Log:
  - Don't hardcode the protocol name when stripping out the protocol and
    host name when the client submits a full URL.
  
  Revision  Changes    Path
  1.27      +13 -11    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java
  
  Index: HttpProcessor.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- HttpProcessor.java        2001/06/18 00:14:44     1.26
  +++ HttpProcessor.java        2001/06/18 06:22:27     1.27
  @@ -1,7 +1,6 @@
  -/*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.26 2001/06/18 00:14:44 remm Exp $
  - * $Revision: 1.26 $
  - * $Date: 2001/06/18 00:14:44 $
  +/* * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpProcessor.java,v
 1.27 2001/06/18 06:22:27 remm Exp $
  + * $Revision: 1.27 $
  + * $Date: 2001/06/18 06:22:27 $
    *
    * ====================================================================
    *
  @@ -107,7 +106,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.26 $ $Date: 2001/06/18 00:14:44 $
  + * @version $Revision: 1.27 $ $Date: 2001/06/18 06:22:27 $
    */
   
   final class HttpProcessor
  @@ -738,13 +737,16 @@
           }
   
           // Checking for an absolute URI (with the HTTP protocol)
  -        if (uri.startsWith("http://";)) {
  +        if (!uri.startsWith("/")) {
  +            int pos = uri.indexOf("://");
               // Parsing out protocol and host name
  -            int pos = uri.indexOf('/', "http://".length());
  -            if (pos == -1) {
  -                uri = "";
  -            } else {
  -                uri = uri.substring(pos);
  +            if (pos != -1) {
  +                pos = uri.indexOf('/', pos + 3);
  +                if (pos == -1) {
  +                    uri = "";
  +                } else {
  +                    uri = uri.substring(pos);
  +                }
               }
           }
   
  
  
  

Reply via email to