[Webtest] BUG in httpclient/webtest combo? - comma NOT allowed in a cookie value

Marc Guillemot Marc Guillemot <mguillemot@yahoo.fr>
Mon, 18 Aug 2008 09:08:51 +0200


Hi,

this looks like a bug. Can you open an issue by HtmlUnit for that?

Cheers,
Marc.
-- 
Blog: http://mguillem.wordpress.com


Mircea Cocosila wrote:
> Hi,
> 
> It seems there is a bug in the way Webtest/httpclient handles cookies.
> 
> Problem description: I watched the HTTP headers in Firefox and
> everything works fine there. Please look at the Set-Cookie and Cookie
> http headers below as seen in Firefox.
> 
> The cookie I'm interested in came in a http response header like this:
> Set-Cookie: CTMBR=29990,Test,Van Auken,opNonElite,CPP; path=/;
> 
> Then the cookie was sent out in subsequent http requests like this:
> Cookie: CTMBR=29990,Test,Van Auken,opNonElite,CPP
> 
> Now, this is what I see in the webtest console:
> [clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) -
> Cookie accepted: "CTMBR=29990"
> [clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) -
> Cookie accepted: "Test="
> [clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) -
> Cookie accepted: "Van Auken="
> [clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) -
> Cookie accepted: "opNonElite="
> [clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) -
> Cookie accepted: "CPP="
> 
> 
> It's clear that webtest/httpclient is misled by the comma in the cookie
> value and erroneously parses the cookie as a series of cookies.
> 
> Any work around by setting some magic configuration?
> 
> Thanks,
> Mircea