Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Chnaged from URI.getQuery to URI.getRawQuery as getQuery decodes as p…

…er the JVM and this converts certain characters into non-UTF-8 characters
  • Loading branch information...
commit 4c08644267ac783ecfda4801a8ac84c5e39465ff 1 parent a1ab02f
@gnandiga authored
View
2  pom.xml
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>biz.neustar</groupId>
<artifactId>browsermob-proxy</artifactId>
- <version>2.0-beta-6-SNAPSHOT</version>
+ <version>2.0-beta-7-SNAPSHOT</version>
<name>BrowserMob Proxy</name>
<description>A programmatic HTTP/S designed for performance and functional testing</description>
<url>http://opensource.webmetrics.com/browsermob-proxy</url>
View
2  src/main/java/org/browsermob/proxy/http/BrowserMobHttpClient.java
@@ -526,7 +526,7 @@ private BrowserMobHttpResponse execute(BrowserMobHttpRequest req, int depth) {
har.getLog().addEntry(entry);
}
- String query = method.getURI().getQuery();
+ String query = method.getURI().getRawQuery();
if (query != null) {
MultiMap<String> params = new MultiMap<String>();
UrlEncoded.decodeTo(query, params, "UTF-8");
View
15 src/test/java/org/browsermob/proxy/http/BrowserMobHttpClientTest.java
@@ -1,26 +1,31 @@
package org.browsermob.proxy.http;
+import org.eclipse.jetty.util.MultiMap;
+import org.eclipse.jetty.util.UrlEncoded;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.net.URI;
import java.net.URISyntaxException;
public class BrowserMobHttpClientTest
{
- @org.junit.Test
+ @Test
public void verifyURI()
{
BrowserMobHttpClient client = new BrowserMobHttpClient();
try
{
- String url = "http://cs.cruise.com/cs/default.aspx?type=left&logo=0&bestdeal=1&pc=n&skin=001&pin=%3C%=pin%%3E&did=-1&txt=224273&target=_top";
+ String url = "http://example.com/cs/default.aspx?type=left&logo=0&bestdeal=1&pc=n&skin=001&pin=%3C%=pin%%3E&did=-1&txt=224273&target=_top";
client.makeUri(url);
- client.makeUri("http://cs.cruise.com/cs/default.aspx");
+ client.makeUri("http://example.com/cs/default.aspx");
} catch (URISyntaxException e)
{
- org.junit.Assert.fail("Exception was not supposed to happen here: " + e.getMessage());
+ Assert.fail("Exception was not supposed to happen here: " + e.getMessage());
}
}
-
}
Please sign in to comment.
Something went wrong with that request. Please try again.