tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1359342 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/Response.java test/org/apache/catalina/connector/TestResponse.java webapps/docs/changelog.xml
Date Tue, 10 Jul 2012 19:31:23 GMT
On 10/07/2012 10:59, Konstantin Kolinko wrote:
> 2012/7/9  <markt@apache.org>:
>> Author: markt
>> Date: Mon Jul  9 19:11:54 2012
>> New Revision: 1359342
>>
>> URL: http://svn.apache.org/viewvc?rev=1359342&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53062
>> Correctly handle case where redirect URL includes a query string (with test cases)
>>
>> Modified:
>>     tomcat/tc7.0.x/trunk/   (props changed)
>>     tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
>>     tomcat/tc7.0.x/trunk/test/org/apache/catalina/connector/TestResponse.java
>>     tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
>>
>> Propchange: tomcat/tc7.0.x/trunk/
>> ------------------------------------------------------------------------------
>>   Merged /tomcat/trunk:r1359340
>>
>> Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
>> URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=1359342&r1=1359341&r2=1359342&view=diff
>> ==============================================================================
>> --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
>> +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java Mon Jul
 9 19:11:54 2012
>> @@ -1752,6 +1752,18 @@ public class Response
>>       * Code borrowed heavily from CoyoteAdapter.normalize()
>>       */
>>      private void normalize(CharChunk cc) {
>> +        // Strip query string first (doing it this way makes the logic a lot
>> +        // simpler)
>> +        int query = cc.indexOf('?');
> 
> Maybe it needs process anchors if query is absent. Something like this:
> if (query < 0) {
> query = cc.indexOf('#');
> }

Agreed. I'll add some more unit tests to confirm and update as necessary.

> 
>> +        char[] queryCC = null;
>> +        if (query > -1) {
>> +            queryCC = new char[cc.getEnd() - query];
> 
> java.util.Arrays.copyOfRange(char[],int from,int to) ?

Yep.

Cheers,

Mark

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


Mime
View raw message