https://issues.apache.org/bugzilla/show_bug.cgi?id=56462
Bug ID: 56462
Summary: HTTPClient fail to follow relative redirects
Product: JMeter
Version: 2.10
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: HTTP
Assignee: [email protected]
Reporter: [email protected]
In case a response contain the Location header with a relative value (not a
full URL), the sampler fails with following error:
2014/04/27 11:48:54 ERROR - jmeter.protocol.http.sampler.HTTPHC4Impl: Error in
redirect URL for GET http://XXX:1080/redir.php HTTP/1.1
Could not sanitize URL: /
java.net.MalformedURLException: no protocol: /
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:337)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
at java.lang.Thread.run(Unknown Source)
2014/04/27 11:48:54 ERROR - jmeter.samplers.SampleResult: sampleEnd called
twice java.lang.Throwable: Invalid call sequence
at
org.apache.jmeter.samplers.SampleResult.sampleEnd(SampleResult.java:1033)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:390)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1094)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
at java.lang.Thread.run(Unknown Source)
In browsers this redirect is working fine.
This is true for the HTTPClient implementation only and works fine under the
old Java implementation.
It seems like it works under the Java implementation due to bug fix:
https://issues.apache.org/bugzilla/show_bug.cgi?id=46690
Sample of PHP script to reproduce the issue:
<?php
header( 'Location: /' ) ;
?>
Sample of JSP script to reproduce the issue:
<%
// sendRedirect works fine as it seems like the implementations fix the
location to a full path (in HttpServletResponse)
//response.sendRedirect("/");
// setting the header specifically reproduce the issue
response.setHeader("Location", "/");
response.setStatus(302);
%>
--
You are receiving this mail because:
You are the assignee for the bug.