cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1494092 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Date Tue, 18 Jun 2013 10:07:50 GMT
Author: sergeyb
Date: Tue Jun 18 10:07:50 2013
New Revision: 1494092

URL: http://svn.apache.org/r1494092
Log:
[CXF-5084] Updating UriBuilderImpl to better detect HTTP scheme, applying a patch on behalf
of David Blevins

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=1494092&r1=1494091&r2=1494092&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Tue Jun 18 10:07:50 2013
@@ -744,7 +744,7 @@ public class UriBuilderImpl extends UriB
         // be supported though the use of non-http schemes for *building* new URIs
         // is pretty limited in the context of working with JAX-RS services
          
-        return path.startsWith("http");
+        return path.startsWith("http:") || path.startsWith("https:");
     }
     
     @Override

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=1494092&r1=1494091&r2=1494092&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Tue Jun 18 10:07:50 2013
@@ -531,6 +531,13 @@ public class UriBuilderImplTest extends 
     }
     
     @Test
+    public void testReplacePathHttpString() throws Exception {
+        URI uri = new URI("http://foo/bar/baz;m1=m1value");
+        URI newUri = new UriBuilderImpl(uri).replacePath("httppnewpath").build();
+        assertEquals("URI is not built correctly", "http://foo/httppnewpath", newUri.toString());
+    }
+    
+    @Test
     public void testReplaceNullPath() throws Exception {
         URI uri = new URI("http://foo/bar/baz;m1=m1value");
         URI newUri = new UriBuilderImpl(uri).replacePath(null).build();



Mime
View raw message