cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6853] Reverting HttpUtils change, adding a test
Date Wed, 30 Mar 2016 14:18:45 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 49ba8067e -> 789e12c7f


[CXF-6853] Reverting HttpUtils change, adding a test


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/789e12c7
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/789e12c7
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/789e12c7

Branch: refs/heads/3.1.x-fixes
Commit: 789e12c7fbdcb97dc7ff6be8426f08ecc4948a68
Parents: 49ba806
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Mar 30 15:16:09 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Mar 30 15:18:13 2016 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java   | 10 ----------
 .../org/apache/cxf/systest/jaxrs/BookApplication2.java    |  2 +-
 .../org/apache/cxf/systest/jaxrs/BookStorePerRequest.java |  6 ++++++
 .../systest/jaxrs/JAXRSClientServerNonSpringBookTest.java |  2 +-
 4 files changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/789e12c7/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
index 05b3538..e945943 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
@@ -22,7 +22,6 @@ package org.apache.cxf.jaxrs.utils;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -500,15 +499,6 @@ public final class HttpUtils {
     public static String getPathToMatch(String path, String address, boolean addSlash) {
         
         int ind = path.indexOf(address);
-        try {
-            String decodeAddr = URLDecoder.decode(address, "UTF-8");
-            if (ind == -1 && !address.equals(decodeAddr)) {
-                address = decodeAddr;
-                ind = path.indexOf(address);
-            }
-        } catch (UnsupportedEncodingException e) {
-            //
-        }
         if (ind == -1 && address.equals(path + "/")) {
             path += "/";
             ind = 0;

http://git-wip-us.apache.org/repos/asf/cxf/blob/789e12c7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication2.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication2.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication2.java
index c89bed2..b424f7d 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication2.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookApplication2.java
@@ -22,7 +22,7 @@ import javax.servlet.ServletContext;
 import javax.ws.rs.ApplicationPath;
 import javax.ws.rs.core.Context;
 
-@ApplicationPath("/thebooks2")
+@ApplicationPath("/the%20books2")
 public class BookApplication2 extends BookApplication {
     public BookApplication2(@Context ServletContext sc) {
         super(sc);

http://git-wip-us.apache.org/repos/asf/cxf/blob/789e12c7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
index c524b81..1b42dd5 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStorePerRequest.java
@@ -82,6 +82,12 @@ public class BookStorePerRequest {
     }
     
     @GET
+    @Path("/book%20headers/")
+    public Book getBookByHeader2() throws Exception {
+        return getBookByHeader();
+    }
+    
+    @GET
     @Path("/bookheaders/")
     public Book getBookByHeader() throws Exception {
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/789e12c7/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
index b8b3ec9..75e966e 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerNonSpringBookTest.java
@@ -183,7 +183,7 @@ public class JAXRSClientServerNonSpringBookTest extends AbstractBusClientServerT
     @Test
     public void testGetBook123TwoApplications() throws Exception {
         doTestPerRequest("http://localhost:" + PORT + "/application6/thebooks/bookstore2/bookheaders");
-        doTestPerRequest("http://localhost:" + PORT + "/application6/thebooks2/bookstore2/bookheaders");
+        doTestPerRequest("http://localhost:" + PORT + "/application6/the%20books2/bookstore2/book%20headers");
     }
     
     private Response doTestPerRequest(String address) throws Exception {


Mime
View raw message