Bug 48568 - CookieManager broken for AjpSampler
CookieManager broken for AjpSampler
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.3.4
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
: PatchAvailable
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-01-18 10:03 UTC by Rainer Jung
Modified: 2010-01-18 17:19 UTC (History)
0 users



Attachments
Patch against trunk (2.05 KB, patch)
2010-01-18 10:03 UTC, Rainer Jung
Details | Diff
Patch against 2.3.4 (2.07 KB, patch)
2010-01-18 10:04 UTC, Rainer Jung
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2010-01-18 10:03:11 UTC
Created attachment 24855 [details]
Patch against trunk

We noticed two bugs when using the AjpSampler in combination with CookieManager:

A) The cookie header is formatted incorrect and therefore not accepted by the application

B) The cookie information is not passed along to the HTTPSampleResult

Problem A) comes from formatting the cookie via getStringValue(), which returns something like a tab formatted list of the Cookie attributes. You can use a simple JSP or Servlet containing

String cookie=request.getHeader("Cookie");
if (cookie != null) {
    out.println("Cookie: " + cookie);
}

to verify this. The fix consists in using an actual Cookie object instead of a generic JMeterProperty and then retrieving Cookie name and value via getName() and getValue().

Problem B) is fixed by calling res.setCookies().

See the atahced patches.

Thanks for the great Apache JMeter software!
Comment 1 Rainer Jung 2010-01-18 10:04:02 UTC
Created attachment 24856 [details]
Patch against 2.3.4
Comment 2 Sebb 2010-01-18 17:19:01 UTC
Good catch, thanks!


URL: http://svn.apache.org/viewvc?rev=900635&view=rev
Log:
Bug 48568 - CookieManager broken for AjpSampler