tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Orlando Caro <JC...@encoredev.com>
Subject [PATCH] for StaticInterceptor.FileHandler bug in filenames with s paces
Date Thu, 08 Mar 2001 17:04:32 GMT
Patch for org.apache.tomcat.request.StaticInterceptor.FileHandler 
Bug confirmed on Tomcat 3.2.1 and 3.2.2b1
Patch tested under Win2K

On filenames with spaces Context.getRealPath() doesn't convert %20 back to
spaces.
FileUtil.safePath() which is used by the method above comments state "On
Windows, makes "x.jsp.", "x.Jsp", and "x.jsp%20" return 404 instead of the
JSP source"

Diff against 3.2.1 release build.
$ diff StaticInterceptor.java StaticInterceptorPATCH.java
191c191,195
<      absPath = ctx.getRealPath( pathInfo );
---
>             /* PATCH (jcaro@encoredev.com) - Context.getRealPath() is not
decoding the path. Why?
>              * Filenames with spaces caused '404 - File Not Found' because
%20 is not being decoded.
>              */
>      absPath = java.net.URLDecoder.decode( ctx.getRealPath(pathInfo) );
>      //absPath = ctx.getRealPath( pathInfo );

Note that I'm not subscribed to the list. 

Cheers,
Orlando
jcaro@encoredev.com

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


Mime
View raw message