apache / apache/jmeter

When path contains %3A, JMeter sends the decoded path ((":" instead of "%3A")

Open
#5,047 3 comments 0 reactions 0 assignees View on GitHub
need info os: All P2
Dominant language
Java
Stars
9.5k
Forks
2.3k
Avg merge
1d 22h
Merged PRs (30d)
5

Description

**Jerome** ([Bug 63343](https://bz.apache.org/bugzilla//show_bug.cgi?id=63343&redirect=false)):
-- ISSUE --

Hi

Seems like an issue with url encoding characters in path. We have an http request with the following path:
"/s/rco-us/this-little-trailblazer%3A-a-girl-power-primer/9781338281798-rco-us.html?cgid=C_6"

It happens only with HttpClient 4.5.x. When selecting "Java" http implementation, the request works fine. The server must absolutely receive the request as is (with ""%3A" in path, not ":").

-- ACTUAL RESULT --

When the http request path contains "%3A", it replaces "%3A" by ":" (url decoded char). Our server fails to read the request in that case.

-- EXPECTED RESULT --

JMeter should send "%3A" within the path as is. It should not decode "%3A" to ":" before sending the request.

-- MORE INFO --

When replaying this request in JMeter, it fails (the server performs a redirect to the homepage). Chrome and Firefox work well:

- When capturing the request sent by JMeter using Fiddler, JMeter replaces the "%3A" by ":" in the request path,
- Browsers like Chrome or Firefox send the URL encoded request path (thus leaving "%3A" as is).

We're not expecting fiddler to url decode the request path before sending it. It should leave it as is (or url encode characters forbidden in urls).

As stated in RFC 3986, reserved characters should be url encoded using "Percent-Encoding":
https://en.wikipedia.org/wiki/Percent-encoding

-- STEPS TO REPRODUCE --

1. Open JMX,
2. Execute in JMeter with Fiddler as proxy,
3. Request in Fiddler shows JMeter sends http request path with ":" instead of "%3A",
4. Web browser send "%3A", not ":", when executing the same http request.

Created attachment [encoding-issue.zip](https://apache.github.io/jmeter-bugzilla-attachments/43/63343/36524/encoding-issue.zip): ZIP with JMX, Recorded HAR from Web-Browser and Fiddler Screenshot

Severity: normal
OS: All

Contributor guide

Open the contributing guide

Research direction

Start with JMeter's HttpClient 4.5.x implementation and reproduce the request using the attached encoding-issue.zip, JMX, and Fiddler evidence. Compare the request path sent through the HttpClient and Java implementations; done means the HttpClient path preserves "%3A" instead of sending ":".

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
networking, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.