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 Fri, 09 Apr 2010 14:36:08 GMT
On 09/04/2010, Nikita Tovstoles <nikita.tovstoles@gmail.com> wrote:
> Shoot - maybe I am missing something - that code path only gets executed
>  when 'redirect automatically' is unchecked and 'follow redirects' is
>  checked. Reading the user manual, I guess that's what one'd want...

Yes - "redirect automatically" is done by the HTTP implementation so
JMeter never sees it.

>  On Thu, Apr 8, 2010 at 9:26 PM, Nikita Tovstoles <nikita.tovstoles@gmail.com
>
> > wrote:
>
>  > Attached, please find a trunk patch that
>  > introduces ConversionUtils.removeSlashDotDot(url) method called
>  > from HttpSamplerBase.followRedirects(HTTPSampleResult, int) only. There's
>  > also a unit test.
>  >
>  > There's no switch because a) I wasn't sure where to add one b) no unit
>  > tests failed. If that's absolutely required and other folks have no cycles
>  > to add such as switch do let me know and I'll see what I can do (or I should
>  > say when). Otherwise, let me know if anything else's required to accept the
>  > patch.
>  >
>  > -nikita
>  >
>  >
>  >
>  >
>  > On Thu, Apr 8, 2010 at 8:39 AM, Nikita Tovstoles <
>  > nikita.tovstoles@gmail.com> wrote:
>  >
>  >> Wicket renders *relative* URLs leading with '../' in CSS, image links (and
>  >> possibly anchors). However, in this case the problem is with absolute URLs
>  >> containing '/../'. Those are created during redirects only because:
>  >>
>  >>    - wicket issues a redirect to a *relative* url starting with '../'
>  >>    - Tomcat, before writing out a response, rewrites the URL as absolute
>  >>    - w/o collapsing the path. See encodeRedirectURL here:
>  >>    http://kickjava.com/src/org/apache/catalina/connector/Response.java.htm
>  >>
>  >> I'll take a stab at collapsing the URL
>  >> in HttpSamplerBase.followRedirects(HTTPSampleResult, int)
>  >>
>  >> -nikita
>  >>
>  >>
>  >> On Wed, Apr 7, 2010 at 10:53 AM, sebb <sebbaz@gmail.com> wrote:
>  >>
>  >>> 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
>  >>>
>  >>>
>  >>
>  >>
>  >
>  >
>

---------------------------------------------------------------------
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