-1

This may break existing test plans, and is contrary to the
component_reference documentation.

On 14 July 2015 at 22:31,  <pmoua...@apache.org> wrote:
> Author: pmouawad
> Date: Tue Jul 14 21:31:34 2015
> New Revision: 1691090
>
> URL: http://svn.apache.org/r1691090
> Log:
> Bug 58137 - JMeter fails to download embedded URLS that contain illegal 
> characters in URL (it does not escape them)
> Bugzilla Id: 58137
>
> Modified:
>     
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
>
> Modified: 
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
> URL: 
> http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java?rev=1691090&r1=1691089&r2=1691090&view=diff
> ==============================================================================
> --- 
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
>  (original)
> +++ 
> jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBase.java
>  Tue Jul 14 21:31:34 2015
> @@ -1242,7 +1242,7 @@ public abstract class HTTPSamplerBase ex
>                          log.warn("Null URL detected (should not happen)");
>                      } else {
>                          String urlstr = url.toString();
> -                        String urlStrEnc=encodeSpaces(urlstr);
> +                        String 
> urlStrEnc=escapeIllegalURLCharacters(encodeSpaces(urlstr));
>                          if (!urlstr.equals(urlStrEnc)){// There were some 
> spaces in the URL
>                              try {
>                                  url = new URL(urlStrEnc);
> @@ -1352,6 +1352,23 @@ public abstract class HTTPSamplerBase ex
>      }
>
>      /**
> +     * @param url URL to escape
> +     * @return escaped url
> +     */
> +    private String escapeIllegalURLCharacters(String url) {
> +        try {
> +            String escapedUrl = 
> ConversionUtils.escapeIllegalURLCharacters(url);
> +            if(log.isDebugEnabled()) {
> +                log.debug("Successfully escaped url:'"+url +"' 
> to:'"+escapedUrl+"'");
> +            }
> +            return escapedUrl;
> +        } catch (Exception e1) {
> +            log.error("Error escaping URL:'"+url+"', 
> message:"+e1.getMessage());
> +            return url;
> +        }
> +    }
> +
> +    /**
>       * Extract User-Agent header value
>       * @param sampleResult HTTPSampleResult
>       * @return User Agent part
>
>

Reply via email to