Bug 54351 - HC4 and URI fragments is failing
Summary: HC4 and URI fragments is failing
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.8
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL: http://shmuels.blogspot.de/2012/12/ht...
Depends on:
Blocks: 54482
  Show dependency tree
Reported: 2012-12-26 09:51 UTC by shmulikk
Modified: 2013-08-08 09:37 UTC (History)
1 user (show)

Screen shots comparing HC3 and HC4 behavior (182.93 KB, image/png)
2012-12-26 11:34 UTC, shmulikk
Test Plan showing issue (14.60 KB, application/xml)
2012-12-31 13:49 UTC, Philippe Mouawad
JSP to put in /examples/jsp folder of Tomcat6 (968 bytes, text/plain)
2012-12-31 13:50 UTC, Philippe Mouawad

Note You need to log in before you can comment on or make changes to this bug.
Description shmulikk 2012-12-26 09:51:39 UTC
When using HC4 and a URI fragments (i.e. http://en.wikipedia.org/wiki/Fragment_identifier#Examples) then the fragment part ("#Examples") is also sent as part of the HTTP Request.

In previous versions: HC3.1 and Java HTTP Samplers this didn't occurred.

I am unsure if that's a bug in JMeter or should be handled on HC side, but debugging these samplers in JMeter code, shows that in HC3 we use:
httpMethod = new GetMethod(urlStr);

While on HC4 we have a different usage:
httpRequest = new HttpGet(uri);
HttpResponse httpResponse = httpClient.execute(httpRequest, localContext); // perform the sample

Seems like the previous implementation excluded the fragment part of the request, following: http://tools.ietf.org/html/rfc3986#section-3.5  while the new one doesn't.

This broken behavior causing errors for some applications, i.e. in my test, the application fails to parse and serve the request.
Comment 1 shmulikk 2012-12-26 09:54:54 UTC
Another point is that I don't specify this fragment as part of the path, it is the application which returns me with a 302 redirect to a URL like this.
For now I am working around this, by using the older HC3.1 implementation.
Comment 2 Philippe Mouawad 2012-12-26 10:07:17 UTC
Thanks for report.
Can you attach a document with screenshots of what you get and which url are wrong ?
Also a jmeter.log file showing issue if you get any stacktrace ?

Thank you
Comment 3 shmulikk 2012-12-26 11:34:49 UTC
Created attachment 29794 [details]
Screen shots comparing HC3 and HC4 behavior

Please note the response came from /post.jspa is a 302 redirect to /message/1000#1000 in both cases but the following request (follow redriects) is the problematic one on HC4.
Comment 4 shmulikk 2012-12-26 11:36:11 UTC
No errors on JMeter side.
Comment 5 Philippe Mouawad 2012-12-31 13:26:09 UTC
I checked behaviour and JAVA Impl and HC4 behave the same way, they send the fragment.
HC3.1 does not.
Comment 6 Philippe Mouawad 2012-12-31 13:27:29 UTC
(In reply to comment #5)
> Hello,
> I checked behaviour and JAVA Impl and HC4 behave the same way, they send the
> fragment.
> HC3.1 does not.

Oups, no you are right, java removes fragment
Comment 7 Philippe Mouawad 2012-12-31 13:49:24 UTC
Seems to have been submitted previously:


But I reproduced it and opened:
Comment 8 Philippe Mouawad 2012-12-31 13:49:46 UTC
Created attachment 29801 [details]
Test Plan showing issue
Comment 9 Philippe Mouawad 2012-12-31 13:50:27 UTC
Created attachment 29802 [details]
JSP to put in /examples/jsp folder of Tomcat6
Comment 10 Philippe Mouawad 2013-01-01 20:31:30 UTC
Fix will be available as soon as HttpClient-4.2.3 is released
Comment 11 shmulikk 2013-01-01 21:23:42 UTC
Thanks Philippe - I am following...
Happy new year :)
Comment 12 Philippe Mouawad 2013-01-15 13:02:08 UTC
Date: Tue Jan 15 12:58:03 2013
New Revision: 1433386

URL: http://svn.apache.org/viewvc?rev=1433386&view=rev
Bug 54351 - HC4 and URI fragments is failing
Bugzilla Id: 54351


Date: Tue Jan 15 13:00:14 2013
New Revision: 1433387

URL: http://svn.apache.org/viewvc?rev=1433387&view=rev
Bug 54351 - HC4 and URI fragments is failing
Bugzilla Id: 54351

    jmeter/trunk/lib/   (props changed)
Comment 13 The ASF infrastructure team 2022-09-24 20:37:52 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3022