Hi Vincent,
 can you test this one for me, and let me know if all is now ok??


Vincent Massol wrote:

>I have had a closer look at my code ... :-) and the problem is not where
>I though it was. Actually, I do specify the domain for each cookie so
>this is not the issue.
>
>The issue is with the cookie "path". I do not specify any path for my
>cookies. This is in conformance with the Cookie class that has a
>constructor that do not take a path parameter (i.e. it is not mandatory
>and can be null).
>
>Actually the Cookie.matches() method allows for null paths.
>
>However, it seems the newly introduced compare() method breaks this as
>it does not check for a null path !
>
>Also, in createCookieHeader() method (around line 474), there is :
>
>        Set addedCookies = new TreeSet(cookies[0]);
>        for(int i=0;i<cookies.length;i++) {
>            if(cookies[i].matches(domain,port,path,secure,now)) {
>                addedCookies.add(cookies[i]);
>                added = true;
>            }
>        }
>
>thus, it seems cookies[0] gets added twice ? Or at least, it gets
>checked when it is not needed, as the add() triggers a comparison to see
>if the element (Cookie) already exist in the Tree, and the
>Cookie.compare() method is called.
>
>Can someone correct this please (sorry I have no time right now. It
>actually already took me some time to find this backward-compatibility
>break ! :-)
>
>I highly suggest that you start by writing a test case that creates a
>Cookie with no path specified and then try to call createCookieHeader().
>Thus it it will fail. Then, correct the code. This way, it won't happen
>again ... :-)
>
>Thanks
>-Vincent
>
--
dIon


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to