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 About URL-path bug of Tomcat 3.1
Date Thu, 01 Jan 1970 00:00:00 GMT
Hi,

I have seen the most recent source of the class
share.org.apache.tomcat,service.http.HttpRequestAdapter (Revision: 1.15).

    $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
1.15 2000/05/26 17:32:16 costin Exp $
    $Revision: 1.15 $
    $Date: 2000/05/26 17:32:16 $


But this contains a URL-path bug, i.e.,
Tomcat cannot not mapped the encoded URL-path such as

     http://localhost:8080/ex%61mples/jsp

I regard that It should be mapped to http://localhost:8080/examples/jsp.

To fix this bug, I have modified HttpRequestAdapter.

Before modifying:

	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 );
	}

After modifying:

	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 );
	}

        // Add only these three lines to fix a URL-path bug.
        if (requestURI != null && requestURI.indexOf('%') >= 0) {
            requestURI = RequestUtil.URLDecode(requestURI);
        }



I hope that this URL-path bug will be fixed.


Thanks a lot

--
Kim



Mime
View raw message