jait-purohit / tamacat

Automatically exported from code.google.com/p/tamacat
0 stars 0 forks source link

Can't convert the "Set-Cookie" header's path. #2

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Can't convert the "Set-Cookie" header's path.

Target methods: ReverseUtils.getConvertedSetCookieHeader(String dist, String 
src, String line) 

What steps will reproduce the problem:
case1. Set-Cookie header's path likes ";Path=/XXX". (support "; Path=/XXX" 
only.)
case2. It is a case where the "path=" string of the Set-Cookie header is a 
small letter (for example, "path=/XXX").  (CASE SENSITIVE)

Then, since a Back-End server's path is returned, the browser cannot set 
Cookie. 

Original issue reported on code.google.com by tamacat.org on 6 Jan 2012 at 7:00

GoogleCodeExporter commented 8 years ago
before:
 return line.replaceAll("; Path=" + d, "; Path=" + s);

after:
 return Pattern.compile(";\\s*Path=" + d, Pattern.CASE_INSENSITIVE).matcher(line).replaceAll("; Path=" + s);

Before:
 line.replace("domain=" + dist, "domain=" + src)

After:
 Pattern.compile("domain=" + dist, Pattern.CASE_INSENSITIVE).matcher(line).replaceAll("domain=" + src)

Commit log:
 r517 2012-01-10 21:31 Issue 2:Can't convert the "Set-Cookie" header's path. (bugfix domain convert)
 r516 2012-01-07 04:03 Issue 2:Can't convert the "Set-Cookie" header's path. support ";Path=/xxx" and "path=/xxx" (CASE INSENSITIVE)

Fixed version: 0.9.1 or 1.0

Original comment by tamacat.org on 10 Jan 2012 at 12:47