jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: rewrite absolute URLs containing '/../'?
Date Wed, 07 Apr 2010 17:53:37 GMT
On 07/04/2010, Nikita Tovstoles <nikita.tovstoles@gmail.com> wrote:
> Hello,
>
>  I need JMeter to rewrite absolute URLs containing '/../'  For example, major
>  browsers & wget, given:
>
>  http://www.google.com/products/ . . / products
>  (spaces added to avoid SPAM filtering)
>
>  will actually send HTTP GET for
>
>  http://www.google.com/products/
>
>  JMeter 2.3.4 appears to send the initial URL verbatim, which results in a
>  404 if pointed against a vanilla Tomcat.
>
>  We're using Wicket and URLs similar to the above are very common (Wicket
>  issues redirects like the above). I saw discussions from a couple of months
>  ago wrt whose responsibility it is to normalize the URL and read the RFC. I
>  understand positions on either side, but, unfortunately, do really need to
>  load test our app asap ;-
>
>  So, I am happy to fork JMeter locally, if needed. If the above indeed
>  requires a code change in JMeter (or HttpClient?) could someone please
>  respond with a hint as to where specifically I should look in src?

The method is

org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(URL u,
String method, boolean areFollowingRedirect, int depth)

This is abstract, and is overridden by various samplers, including:

org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(URL url,
String method, boolean areFollowingRedirect, int frameDepth)

org.apache.jmeter.protocol.http.sampler.HTTPSampler2.sample(URL url,
String method, boolean areFollowingRedirect, int frameDepth)

However, if you want to just fix redirects, this could be done in

HttpSamplerBase.followRedirects(HTTPSampleResult, int)

Note that JMeter 2.3.4 already allows for relative links starting with ../
See https://issues.apache.org/bugzilla/show_bug.cgi?id=46690.

JMeter could be enhanced to allow such URL fixing as an option.
Changing it unconditionally could break some test scripts.

BTW, are these dotty URLs used anywhere apart from redirects?

>  thanks
>
>  -nikita
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message