Bug 49083

Summary: collapse '/..' in redirect URLs
Product: JMeter Reporter: Nikita Tovstoles <nikita.tovstoles>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: Nightly (Please specify date)   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: patch collapsing '/..' in redirect URLs

Description Nikita Tovstoles 2010-04-09 17:11:16 UTC
Created attachment 25250 [details]
patch collapsing '/..' in redirect URLs

improvement: when following redirects, collapse '/..' in redirect location URLs - like major browsers do:

ie, http://host/app/page1/../../app/page2 becomes http://host/app/page2

Discussion here:
http://markmail.org/thread/3ci5hayvqyjhi2ud

Patch to trunk attached. Introduces ConversionUtils.removeSlashDotDot(url) method called from HttpSamplerBase.followRedirects(HTTPSampleResult, int) only. There's
also a unit test.
Comment 1 Sebb 2010-07-01 18:40:07 UTC
Thanks, fixed in SVN:

URL: http://svn.apache.org/viewvc?rev=959801&view=rev
Log:
Bug 49083 - collapse '/pathsegment/..' in redirect URLs

Modified:
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
   jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
   jakarta/jmeter/trunk/test/src/org/apache/jmeter/protocol/http/util/TestHTTPUtils.java
   jakarta/jmeter/trunk/xdocs/changes.xml
   jakarta/jmeter/trunk/xdocs/usermanual/component_reference.xml

[I added a property to allow the behaviour to be suppressed if necessary]