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

Mircea Cocosila Mircea Cocosila" <mircea@neodonis.com
Sun, 10 Aug 2008 19:10:54 -0400


------=_Part_42337_2909326.1218409854143
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

------=_Part_42337_2909326.1218409854143
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Hi,<br><br>It seems there is a bug in the way Webtest/httpclient handles cookies. <br><br>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.<br>
<br>The cookie I&#39;m interested in came in a http response header like this:<br>Set-Cookie: CTMBR=29990,Test,Van Auken,opNonElite,CPP; path=/;<br><br>Then the cookie was sent out in subsequent http requests like this:<br>
Cookie: CTMBR=29990,Test,Van Auken,opNonElite,CPP<br><br>Now, this is what I see in the webtest console:<br>[clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - Cookie accepted: &quot;CTMBR=29990&quot;<br>
[clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - Cookie accepted: &quot;Test=&quot;<br>[clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - Cookie accepted: &quot;Van Auken=&quot;<br>[clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - Cookie accepted: &quot;opNonElite=&quot;<br>
[clickButton] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - Cookie accepted: &quot;CPP=&quot;<br><br><br>It&#39;s clear that webtest/httpclient is misled by the comma in the cookie value and erroneously parses the cookie as a series of cookies.<br>
<br>Any work around by setting some magic configuration?<br><br>Thanks,<br>Mircea<br></div>

------=_Part_42337_2909326.1218409854143--