Bug 54351 - HC4 and URI fragments is failing
HC4 and URI fragments is failing
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.8
All All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
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)



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

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);
...
client.executeMethod(httpMethod);

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
Hello,
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
Hello,
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:

https://issues.apache.org/jira/browse/HTTPCLIENT-1177

But I reproduced it and opened:
https://issues.apache.org/jira/browse/HTTPCLIENT-1286
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
Log:
Bug 54351 - HC4 and URI fragments is failing
Bugzilla Id: 54351

Modified:
    jmeter/trunk/build.properties
    jmeter/trunk/eclipse.classpath
    jmeter/trunk/res/maven/ApacheJMeter_parent.pom
    jmeter/trunk/xdocs/changes.xml


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

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

Modified:
    jmeter/trunk/lib/   (props changed)