tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pilho Kim <ph...@math.soongsil.ac.kr>
Subject Re: Tomcat 3.1 bug: spaces in URL
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi, 

It is very easy to patch a URL-Path bug of Tomcat 3.2.
You can the URL-encoded string (say, %20, %41, %61) in URL address of browser
if you patch as follows:

jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
CVS Revision 1.16
Tue May 30 06:16:51 2000 UTC 

In the implementation of processRequestLine

	int qryIdx= findChar( '?', startReq, endReq );
	if( qryIdx <0 ) {
	    requestURI = new String( buf, startReq, endReq - startReq );
	} else {
	    requestURI = new String( buf, startReq, qryIdx - startReq );
	    queryString = new String( buf, qryIdx+1, endReq - qryIdx -1 );
	}

        //////////////////////////////////////////////////
        // To patch a URL-Path bug of Tomcat 3.2.
        if (requestURI != null && requestURI.indexOf('%') >= 0) {
            requestURI = RequestUtil.URLDecode(requestURI);
        }


Is it possible that I modify such a patch in CVS ?

Kim


> 
> > It looks like Tomcat 3.1 does not propery handle %20 (space) in the URL.
> You
> > can quickly test this by creating a file "a b c.txt" under the
> > webapps/examples directory and then trying to display the file via HTTP.
> > You'll get a 404 error.
> >
> > Does anybody know if there is fix for it?
> 
> Yeah, i've posted one several times, Costin has promised to integrate it but
> hs a buzy guy apparently...
> 
> I'll send you the fix separately...
> 
> cheers
> 
> Geoff
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
> 


Mime
View raw message