jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1511488 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
Date Wed, 07 Aug 2013 21:05:30 GMT
Author: pmouawad
Date: Wed Aug  7 21:05:29 2013
New Revision: 1511488

URL: http://svn.apache.org/r1511488
Log:
Bug 54482 - HC fails to follow redirects with non-encoded chars
Fix as per sebb comment
Bugzilla Id: 54482

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java?rev=1511488&r1=1511487&r2=1511488&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
(original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/ConversionUtils.java
Wed Aug  7 21:05:29 2013
@@ -18,10 +18,12 @@
 
 package org.apache.jmeter.protocol.http.util;
 
+import java.io.UnsupportedEncodingException;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
+import java.net.URLDecoder;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
@@ -123,15 +125,16 @@ public class ConversionUtils {
      * @param url non-encoded URL
      * @return URI which has been encoded as necessary
      * @throws URISyntaxException
+     * @throws UnsupportedEncodingException 
      */
-    public static final URI sanitizeUrl(URL url) throws URISyntaxException {
+    public static final URI sanitizeUrl(URL url) throws URISyntaxException, UnsupportedEncodingException
{
         URIBuilder builder = 
                 new URIBuilder()
             .setScheme(url.getProtocol())
             .setHost(url.getHost())
             .setPort(url.getPort())
             .setUserInfo(url.getUserInfo())
-            .setPath(url.getPath())
+            .setPath(URLDecoder.decode(url.getPath(), "UTF-8")) // $NON-NLS-1$
             .setQuery(url.getQuery());
         URI uri = builder.build();
         return uri;



Mime
View raw message