Summary: | HTTPRequest HTTPClient incorrectly urlencodes parameter value in POST | ||
---|---|---|---|
Product: | JMeter - Now in Github | Reporter: | Alf Hogemark <alf> |
Component: | HTTP | Assignee: | JMeter issues mailing list <issues> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | 2.2 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: |
Suggested patch
Updated suggested patch |
Description
Alf Hogemark
2007-04-18 03:58:15 UTC
Created attachment 19986 [details] Suggested patch This patch urldecodes parameter value if the httpargument.isAlwaysEncode is false, so that when it is added to the httpclient postmethod, where it is urlencoded, the value will be correct. There is also an commented out section, which uses the HTTPSamplerBase.getQueryString to construct the post body. If this alternative is used, then HTTPSampler and HTTPSampler2 will always send the same POST body. I do not know which alternative you prefer. The patch also contains more unit tests for TestHTTPSamplersAgainstHttpMirrorServer, it contains the new tests suggested in patch for bug 42139, plus some more, to expose this bug. So if this patch for this bug is applied, then bug 42139 should just be closed. If only the unit tests are applied, then you will see that one test will fail for HTTPSampler2, the one with titleValue = "%2FwEPDwULLTE2MzM2OTA0NTYPZBYCAgMPZ%2FrA%2B8DZ2dnZ2dnZ2d%2FGNDar6OshPwdJc%3D"; Created attachment 19987 [details]
Updated suggested patch
I just had to remove to System.out.println lines, which accidential made it
into my first suggested patch.
Thanks! Applied to SVN r530147 - I ignored the TestHTTPSamplersAgainstHttpMirrorServer part as I'd already applied bug 42139. This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/1913 |