summaryrefslogtreecommitdiffstats
path: root/vespaclient-container-plugin
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-24 14:16:11 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-24 14:16:11 +0100
commitae3d728e62bd3ff00ecf14649504aa34773cf63e (patch)
tree944e742dca341c8e4c510e09994f29212b97cade /vespaclient-container-plugin
parent3ba4dac28e917a9d9d86f7879093a84ea8419d0f (diff)
Properly encode the URI to avoid normalization.
Diffstat (limited to 'vespaclient-container-plugin')
-rw-r--r--vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java2
-rw-r--r--vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java
index fc6d20c06b8..6a7797c20a7 100644
--- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java
+++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/RestApi.java
@@ -115,7 +115,7 @@ public class RestApi extends LoggingRequestHandler {
protected HttpResponse handleInternal(HttpRequest request) {
final RestUri restUri;
try {
- restUri = new RestUri(request.getRawUri());
+ restUri = new RestUri(request.getUri());
} catch (RestApiException e) {
return e.getResponse();
} catch (Exception e2) {
diff --git a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java
index 6d642c7c57c..b2a8200b4e1 100644
--- a/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java
+++ b/vespaclient-container-plugin/src/test/java/com/yahoo/document/restapi/RestUriTest.java
@@ -108,7 +108,7 @@ public class RestUriTest {
@Test
public void testDocIdAsIs() throws Exception {
- RestUri restUri = new RestUri(new URI("/document/v1/test/newsarticle/docid/http://vn.news.yahoo.com/gi-th-ng-t-n-ng-khoa-h-205000458.html"));
+ RestUri restUri = new RestUri(new URI("/document/v1/test/newsarticle/docid/http%3a%2f%2fvn.news.yahoo.com%2fgi-th-ng-t-n-ng-khoa-h-205000458.html").normalize());
assertThat(restUri.getNamespace(), is("test"));
assertThat(restUri.getDocumentType(), is("newsarticle"));
assertThat(restUri.getDocId(), is("http://vn.news.yahoo.com/gi-th-ng-t-n-ng-khoa-h-205000458.html"));