cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1071744 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Thu, 17 Feb 2011 18:40:04 GMT
Author: sergeyb
Date: Thu Feb 17 18:40:04 2011
New Revision: 1071744

URL: http://svn.apache.org/viewvc?rev=1071744&view=rev
Log:
Merged revisions 1071743 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1071743 | sergeyb | 2011-02-17 18:36:43 +0000 (Thu, 17 Feb 2011) | 1 line
  
  [CXF-3226] Colons in path segments should not be url encoded by default
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Feb 17 18:40:04 2011
@@ -1 +1 @@
-/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069130,1069138,1069249,1069318,1069492,1069500,1069716,1069720,1069814,1070034,1070430,1070471,1070558,1070778
+/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069130,1069138,1069249,1069318,1069492,1069500,1069716,1069720,1069814,1070034,1070430,1070471,1070558,1070778,1071743

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java?rev=1071744&r1=1071743&r2=1071744&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
Thu Feb 17 18:40:04 2011
@@ -63,7 +63,7 @@ public final class HttpUtils {
     private static final String CHARSET_PARAMETER = "charset";
     
     // there are more of such characters, ex, '*' but '*' is not affected by UrlEncode
-    private static final String PATH_RESERVED_CHARACTERS = "=@/";
+    private static final String PATH_RESERVED_CHARACTERS = "=@/:";
     private static final String QUERY_RESERVED_CHARACTERS = "?/";
     
     private HttpUtils() {

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1071744&r1=1071743&r2=1071744&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Thu Feb 17 18:40:04 2011
@@ -112,6 +112,15 @@ public class BookStore {
         System.out.println("PreDestroy called");
     }
     
+    @GET
+    @Path("/books/colon/{a}:{b}:{c}")
+    @Produces("application/xml")
+    public Book getBookWithColonMarks(@PathParam("a") String id1,
+                                      @PathParam("b") String id2,
+                                      @PathParam("c") String id3) throws BookNotFoundFault
{
+        return doGetBook(id1 + id2 + id3);
+    }
+    
     @POST
     @Path("emptypost")
     public void emptypost() {
@@ -407,6 +416,8 @@ public class BookStore {
         return doGetBook(id);
     }
     
+    
+    
     @GET
     @Path("/books/response/{bookId}/")
     @Produces("application/xml")

Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1071744&r1=1071743&r2=1071744&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Thu Feb 17 18:40:04 2011
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
+import java.net.URLEncoder;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -79,6 +80,25 @@ public class JAXRSClientServerBookTest e
     }
     
     @Test
+    public void testGetBookWithColonMarks() throws Exception {
+        
+        // URLEncoder will turn ":" into "%3A" but ':' is actually
+        // not disallowed in the path components 
+        String endpointAddressUrlEncoded =
+            "http://localhost:" + PORT + "/bookstore/books/colon/" 
+            + URLEncoder.encode("1:2:3", "UTF-8");
+        
+        Response r = WebClient.create(endpointAddressUrlEncoded).get();
+        assertEquals(404, r.getStatus());
+        
+        String endpointAddress =
+            "http://localhost:" + PORT + "/bookstore/books/colon/1:2:3";
+        WebClient wc = WebClient.create(endpointAddress);
+        Book b = wc.get(Book.class);
+        assertEquals(123L, b.getId());
+    }
+    
+    @Test
     public void testPostAnd401WithText() throws Exception {
         
         String endpointAddress =



Mime
View raw message