Bug 60084 - JMeter 3.0 embedded resource URL is silently encoded
Summary: JMeter 3.0 embedded resource URL is silently encoded
Alias: None
Product: JMeter
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 3.0
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2016-09-05 10:06 UTC by Stuart Barlow
Modified: 2016-09-12 14:27 UTC (History)
1 user (show)

Simple test plan with HTTPRequest configured to download embedded resources (5.65 KB, application/xml)
2016-09-05 10:06 UTC, Stuart Barlow
Patch proposal to fix issue (4.01 KB, patch)
2016-09-10 22:05 UTC, Philippe Mouawad
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Barlow 2016-09-05 10:06:38 UTC
Created attachment 34199 [details]
Simple test plan with HTTPRequest configured to download embedded resources

Hi all.

I'm migrating all of my tests to JMeter 3.0 and found some 
that worked fine with earlier versions now fail with 3.0. The 
problem is with HTTP Request embedded resources. I'm using Java 1.7.0_45

A HTTP Request is configured to download all embedded resources but if 
a resource contains some special characters (like '+'), they are 
automatically encoded before being downloaded. This breaks the test.

For example, if the parent HTML contains something like this:

<img alt="Captcha" class="captcha-image" width="100" height="50" 

The + is encoded as %20 and is then unreachable. A HTTP 500 is returned 
instead of the expected content.

Is there a configuration parameter to control this? Or is this a bug?

I have attached a very simple .jmx file to allow you to easily reproduce the problem. You'll also need to create and deploy a HTML containing the above markup to your web server of choice.

Bug 58137 seems like a close match. Did the fix to this bug create the issue I am now seeing? 

Thank you!

Comment 1 Philippe Mouawad 2016-09-07 11:52:25 UTC
Thanks for opening the bug and providing test case.
I'll try to analyze it asap this week.

Comment 2 Philippe Mouawad 2016-09-10 14:52:16 UTC
Your issue is due to fix of Bug 58137.
It appears an url containing + is valid, our processing to escapeIllegal leads to the change from + to %20.

I think we should switch this part of code to use :

But anyway I tested using org.apache.commons.validator.routines.UrlValidator#isValid and your URL appears no to be.
I asked a question on commons user mailing list.
"Question about URLValidator#isValid"

Once I get an answer we'll see what to do.
Comment 3 Philippe Mouawad 2016-09-10 22:05:29 UTC
Created attachment 34230 [details]
Patch proposal to fix issue
Comment 4 Philippe Mouawad 2016-09-11 13:39:57 UTC
Author: pmouawad
Date: Sun Sep 11 13:39:13 2016
New Revision: 1760249

URL: http://svn.apache.org/viewvc?rev=1760249&view=rev
Bug 60084 - JMeter 3.0 embedded resource URL is silently encoded
Bugzilla Id: 60084

Comment 5 Stuart Barlow 2016-09-12 14:27:30 UTC
Those updates fixed the problem. 
Thank you Philippe.