tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/request StaticInterceptor.java
Date Fri, 23 Jun 2000 22:18:44 GMT
costin      00/06/23 15:18:42

  Modified:    src/share/org/apache/tomcat/request StaticInterceptor.java
  Log:
  Fixed bug for static included files - we need to extract the paths from the
  sub request ( or the one in note, which is set when the subreq. is processed - but
  the note is also in subrequest ).
  
  The sub-request mechanism can be greatly simplified in the internal tomcat, but
  we still have a lot of code that needs to be verified, so probably we'll wait for
  next release.
  
  Revision  Changes    Path
  1.5       +8 -5      jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java
  
  Index: StaticInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- StaticInterceptor.java	2000/06/23 02:16:21	1.4
  +++ StaticInterceptor.java	2000/06/23 22:18:40	1.5
  @@ -128,7 +128,8 @@
   	File file=new File( absPath );
   
   	if( file.isFile() ) {
  -	    if( debug > 0 ) log( "Setting handler to file ");
  +	    if( debug > 0 ) log( "Setting handler to file " + absPath);
  +	    req.setNote( realFileNote, absPath );
   	    req.setWrapper(  ctx.getServletByName( "tomcat.fileHandler"));
   	    return 0;
   	}
  @@ -239,11 +240,12 @@
   	    subReq=req.getChild();
   
   	Context ctx=subReq.getContext();
  -	String pathInfo=req.getPathInfo();
  -	String absPath = (String)req.getNote( realFileNote );
  +	String pathInfo=subReq.getPathInfo();
  +	String absPath = (String)subReq.getNote( realFileNote );
   	if( absPath==null ) 
   	    absPath=ctx.getRealPath( pathInfo );
   
  +	if( debug>0) log( "Requested file = " + absPath);
   	String base = ctx.getAbsolutePath();
   	absPath = extraCheck( base, absPath );
   	if( absPath==null ) {
  @@ -252,6 +254,7 @@
   	}
   
   	File file = new File( absPath );
  +	if( debug>0) log( "After paranoic checks = " + absPath);
   	
           String mimeType=ctx.getMimeMap().getContentTypeFor(absPath);
   
  @@ -313,7 +316,7 @@
   	if (absPath.endsWith("/") ||
   	    absPath.endsWith("\\") ||
   	    absPath.endsWith(".")) {
  -	    log("EndsWith \\/.");
  +	    log("Ends with \\/. " + absPath);
   	    return null;
   	}
   
  @@ -366,7 +369,7 @@
   	Request subReq=req;
   	if( inInclude ) subReq = req.getChild();
   	Context ctx=req.getContext();
  -	String pathInfo=req.getPathInfo();
  +	String pathInfo=subReq.getPathInfo();
   	if( pathInfo == null ) pathInfo="";
   	String absPath=ctx.getRealPath( pathInfo );
   	File file = new File( absPath );
  
  
  

Mime
View raw message