Bug 49083 - collapse '/..' in redirect URLs
collapse '/..' in redirect URLs
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
Nightly (Please specify date)
PC All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-04-09 17:11 UTC by Nikita Tovstoles
Modified: 2010-07-01 18:40 UTC (History)
0 users



Attachments
patch collapsing '/..' in redirect URLs (7.54 KB, application/octet-stream)
2010-04-09 17:11 UTC, Nikita Tovstoles
Details

Note You need to log in before you can comment on or make changes to this bug.
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]