tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lar...@apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request AccessInterceptor.java
Date Fri, 16 Feb 2001 19:34:15 GMT
larryi      01/02/16 11:34:14

  Modified:    src/share/org/apache/tomcat/request Tag: tomcat_32
                        AccessInterceptor.java
  Log:
  Hopefully the third time is the charm. Combining the best of previous two fixes.
  
  Use "ctPathL - 2" when needed, so "/abc" matches the url-pattern "/abc/*"
  
  Use "ctPathL - 1" when needed, so "/abc123" and  "/abc.jsp" don't match
  the url-pattern "/abc/*"
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.7  +6 -1      jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/AccessInterceptor.java
  
  Index: AccessInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/Attic/AccessInterceptor.java,v
  retrieving revision 1.12.2.6
  retrieving revision 1.12.2.7
  diff -u -r1.12.2.6 -r1.12.2.7
  --- AccessInterceptor.java	2001/02/16 04:03:13	1.12.2.6
  +++ AccessInterceptor.java	2001/02/16 19:34:11	1.12.2.7
  @@ -323,7 +323,12 @@
   	case Container.PREFIX_MAP:
   	    if( path.length() < ctPathL - 2  )
   		return false;
  -	    return path.startsWith( ctPath.substring(0, ctPathL - 2  ));
  +	    // determine how much to match
  +	    int matchLen = ctPathL - 2;	// match up to, but not including the '/'
  +	    // if more can be matched in the path, include matching the '/'
  +	    if( path.length() > matchLen )
  +		matchLen++;
  +	    return path.startsWith( ctPath.substring(0, matchLen ));
   	case Container.EXTENSION_MAP:
   	    return ctPath.substring( 1 ).equals( URLUtil.getExtension( path ));
   	case Container.PATH_MAP:
  
  
  

Mime
View raw message