You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Orlando Caro <JC...@encoredev.com> on 2001/03/08 18:04:32 UTC
[PATCH] for StaticInterceptor.FileHandler bug in filenames with s
paces
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