You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Larry Isaacs <La...@sas.com> on 2001/01/04 20:34:13 UTC

RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util C harChunk.java ByteChunk.java

Costin,

While discovering this, it appeared to me that Http10.processRequestLine's
call to uriMB.unescapeURL() is destroying the only copy of the URI in its
encoded form.  The servlet 2.2. errata2.2_042700.htm calls for 
getRequestURI() to return an encoded string.  It looks like we might need
to save an encoded copy for this use before unescaping it.  Am I missing
something, or is there a better way?

I'll add my test that checks the getRequestURI() to the "sanity-test" when
the "sanity-test" comes back online.

Larry


-----Original Message-----
From: larryi@apache.org [mailto:larryi@apache.org]
Sent: Thursday, January 04, 2001 8:15 AM
To: jakarta-tomcat-cvs@apache.org
Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util
CharChunk.java ByteChunk.java


larryi      01/01/04 05:14:42

  Modified:    src/share/org/apache/tomcat/util CharChunk.java
                        ByteChunk.java
  Log:
  Update length as chars/bytes are un-escaped
  
  Revision  Changes    Path
  1.4       +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/util/CharChunk.java
  
  Index: CharChunk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/CharChunk.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CharChunk.java	2000/12/30 07:54:16	1.3
  +++ CharChunk.java	2001/01/04 13:14:41	1.4
  @@ -314,6 +314,7 @@
   		if( res=='/' || res=='\0' )
   		    return 400;
   		chars[idx]=(char)res;
  +		charsLen-=2;
   	    }
   	}
   	return 0;
  
  
  
  1.4       +1 -0      jakarta-tomcat/src/share/org/apache/tomcat/util/ByteChunk.java
  
  Index: ByteChunk.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/ByteChunk.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ByteChunk.java	2000/12/30 07:54:16	1.3
  +++ ByteChunk.java	2001/01/04 13:14:41	1.4
  @@ -345,6 +345,7 @@
   		if( res=='/' || res=='\0' )
   		    return 400;
   		bytes[idx]=(byte)res;
  +		bytesLen-=2;
   	    }
   	}
   	return 0;
  
  
  

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

RE: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util C harChunk.java ByteChunk.java

Posted by cm...@yahoo.com.
Hi Larry,

> While discovering this, it appeared to me that Http10.processRequestLine's
> call to uriMB.unescapeURL() is destroying the only copy of the URI in its
> encoded form.  The servlet 2.2. errata2.2_042700.htm calls for 

> getRequestURI() to return an encoded string.  It looks like we might need
> to save an encoded copy for this use before unescaping it.  Am I missing
> something, or is there a better way?

You are right, we need to store the original URI too ( I would do that
only if the URI is encoded - this way most requests will not have to pay
for this ). 

The only problem is that we need to check what we get from Apache ( both
mod_jserv and mod_jk ) - is it encoded or not. 


> I'll add my test that checks the getRequestURI() to the "sanity-test" when
> the "sanity-test" comes back online.

Soon - I got a bit of flu and some urgent issues at work, sanity-test is
my biggest priority in tomcat3.3 space. 

Before I start fixing bugs and merge fixes from 3.2 I want to re-learn the
GTest and start using it. The only way we can make sure we have no
regressions is to have tests for the bugs we fix. 

BTW, we should have a policy that all bug reports that include a
<gtest>-based case will be included imediatly in the sanity-test and will
be fixed with higher priority and faster than other bugs.

Costin