You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Adam Jack <aj...@TrySybase.com> on 2002/11/30 19:56:15 UTC

RE: [PATCH] Cookie's domain attribute check turned out to be casesensitive

Oleg,

Well, when you put it like that (in code) it is kinda obvious. :-)

I have the equivalent of:

  GetMethod method = new GetMethod("http://www.TrySybase.com/");

whereas you have

  GetMethod method = new GetMethod("/");

Now, I did this 'cos I created the method (passing my URL serialized to a
string) prior to knowing that "startSession" even existed. I later added a
startSession(URL) but never thought to go back and change my method to be
relative to the newly formed session. Clearly passing the fully qualified
URL did "something" so I didn't know it was wrong.

I've changed and now have getPath() not toExternalForm() on the URL
instance. This works for me.

I'll leave you to decide if you feel the APIs behaviour is appropriate.

Thanks for all your help tracking this down.

regards

Adam
-----Original Message-----
From: Oleg Kalnichevski [mailto:o.kalnichevski@dplanet.ch]
Sent: Saturday, November 30, 2002 9:25 AM
To: ajack@trysybase.com
Cc: Apache Jakarta
Subject: RE: [PATCH] Cookie's domain attribute check turned out to be
casesensitive


Adam,

Due to some reason not quite clear to me value
"http://www.TrySybase.com/" has been passed as a path of origin. That's
wrong. It should have been "/"
Unfortunately as I can't reproduce this problem here, I can't find out
why the parse() method has gotten the wrong value as an input.

Let's get better organized here. I assume you are familiar with JUnit.
That's the test case I have used trying to reproduce the problem. Could
you please tweak it so that the bug would show up?

Cheers

Oleg






On Sat, 2002-11-30 at 14:42, Adam Jack wrote:
> With last night's gump drop (which I assume has the patches) I get this
> error:
>
> org.apache.commons.httpclient.HttpException: Bad cookie header: illegal
path
> attribute "/". Path of origin: "http://www.TrySybase.com/"
>         at org.apache.commons.httpclient.Cookie.validate(Cookie.java:1006)
>         at org.apache.commons.httpclient.Cookie.parse(Cookie.java:940)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.processResponseHeaders(HttpMeth
> odBase.java:1445)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
> a:1530)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
> ava:2182)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:820
> )
>         at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:455)
>
> regards
>
> Adam
> -----Original Message-----
> From: Kalnichevski, Oleg [mailto:oleg.kalnichevski@bearingpoint.com]
> Sent: Friday, November 29, 2002 12:31 PM
> To: Commons HttpClient Project; ajack@trysybase.com
> Subject: RE: [PATCH] Cookie's domain attribute check turned out to be
> case sensitive
>
>
> Adam, give it a shot with a new patch. I have changed the parse method
quite
> a bit. If the problem persists, just let me know.
>
> What I can see from the logs you have attached is that the server does not
> explicitly specifies cookie's version attribute. The new Httpclient should
> handle this kind of situations better
>
> Oleg
>
> -----Original Message-----
> From: Adam Jack [mailto:ajack@TrySybase.com]
> Sent: Friday, November 29, 2002 7:40 PM
> To: 'Commons HttpClient Project'
> Subject: RE: [PATCH] Cookie's domain attribute check turned out to be
> case sensitive
>
>
> JSD wrote:
>
> > Committed.  Thanks Oleg.
> > Adam, please give a current build a shot.
>
> I've downloaded the build from:
>
> 	http://gump.covalent.net/jars/latest/jakarta-commons/
>
> I tried yesterday (early whilst getting the Turkey up and to room
> temperature for it's big day) and got the same result. Perhaps I was too
> early.
>
> I tried again just now with last night's build. Although the result is
> different (it no longer complaining about the domain attribute) it isn't
as
> I suspect is correct (see below.) Now it complains about "different path".
>
> Thanks for your efforts.
>
> regards
>
> Adam
>
> --------------------------------------------------------------------------
--
> ----------------------
>
> org.apache.commons.httpclient.HttpException: Bad Set-Cookie header:
> sID=172.20.2.225.1038594731743097; path=/; domain=.TrySybase.com,
> sID=172.20.2.225.1038594731743097; path=/; domain=.TrySybase.com Header
> targets a different path, found "/" for "http://www.TrySybase.com/"
>         at org.apache.commons.httpclient.Cookie.parse(Cookie.java:1016)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.processResponseHeaders(HttpMeth
> odBase.java:1445)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.jav
> a:1530)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.j
> ava:2182)
>         at
>
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:820
> )
>         at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:455)
>         at com.trysybase.net.robot.Robot.performTask(Robot.java:186)
>         at com.trysybase.net.robot.Robot.perform(Robot.java:100)
>         at com.trysybase.net.robot.Robot.main(Robot.java:403)
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
> ______________________________________________________________________
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
Oleg Kalnichevski <o....@dplanet.ch>