referred to: HTTP Sampler, HTTP Proxy Server When JMeter follows a redirect (upon a HTTP 302 response) some characters get an unnecessary %-encoding in the URL of the new request, causing some dumb web applications fail. Example: Server response: HTTP/1.1 302 Found Location: /otrs/index.pl?Action=AgentTicketSearch;Subaction=AJAX ... JMeter request: GET /otrs/index.pl?Action=AgentTicketSearch%3BSubaction%3DAJAX HTTP/1.1 ... This behavior did not occur in 2.9. In the obsoleted RFC 2396 ';', '/' and some other characters where not allowed in the query string. In the recent RFC 3986 (STD 66) the rule was relaxed and these are now vaild characters in a query string. Most browsers do also not encode these characters and pass the URL in the same way as they received it in the Location header (exept for the #fragment part). This issue might be related to Bug 54482
The problem seems to be that the code calls ConversionUtils.sanitizeUrl which uses the HttpComponents class org.apache.http.client.utils.URIBuilder to recreate the URL from its component parts. Not sure why, but that uses the same encoding as for form fields. It should probably be using a less restrictive set of safe characters for query encoding.
Looks like this has been fixed in URIBuilder in HC 3.4
An alternative might be to use the URI class for encoding. See also Bug 56231
An similar issue occur with characters outside the allowed set. I came across a web application which insists of using an unencoded pipe sigen ("|", %7C) as part of the query string. I consider this as a bug of that application, but browsers allow this. Therefore JMeter should allow this also, if the option "Encode" is not checked in the HTML-Sampler.
(In reply to ateles.belzebuth.hybridus+apache from comment #4) > An similar issue occur with characters outside the allowed set. I came > across a web application which insists of using an unencoded pipe sigen > ("|", %7C) as part of the query string. I consider this as a bug of that > application, but browsers allow this. Therefore JMeter should allow this > also, if the option "Encode" is not checked in the HTML-Sampler. The Encode option does not apply to redirects - it applies to specific parameters on the HTTP Sampler screem. If there is a problem with samples containing a pipe sign in the query string, please raise a separate issue for that.
URL: http://svn.apache.org/r1578190 Log: URLs get encoded on redirects in HC3.1 & HC4 samplers Only encode if URL is not correctly encoded Bugzilla Id: 56207 Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPUtils.java jmeter/trunk/xdocs/changes.xml
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3333