You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2014/03/03 13:08:59 UTC

[Bug 56207] New: URLs get encoded on redirects

https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

            Bug ID: 56207
           Summary: URLs get encoded on redirects
           Product: JMeter
           Version: 2.11
          Hardware: PC
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: HTTP
          Assignee: issues@jmeter.apache.org
          Reporter: ateles.belzebuth.hybridus+apache@gmail.com

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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects in HC3.1 & HC4 samplers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

--- Comment #4 from ateles.belzebuth.hybridus+apache@gmail.com ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

--- Comment #1 from Sebb <se...@apache.org> ---
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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects in HC3.1 & HC4 samplers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Sebb <se...@apache.org> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects in HC3.1 & HC4 samplers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

--- Comment #3 from Sebb <se...@apache.org> ---
An alternative might be to use the URI class for encoding.
See also Bug 56231

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

--- Comment #2 from Sebb <se...@apache.org> ---
Looks like this has been fixed in URIBuilder in HC 3.4

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects in HC3.1 & HC4 samplers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|URLs get encoded on         |URLs get encoded on
                   |redirects                   |redirects in HC3.1 & HC4
                   |                            |samplers

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56207] URLs get encoded on redirects in HC3.1 & HC4 samplers

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56207

--- Comment #5 from Sebb <se...@apache.org> ---
(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.

-- 
You are receiving this mail because:
You are the assignee for the bug.