cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject [1/2] git commit: [CXF-6020]: UrilInfo.getAbsolutePath() missing path separator between servlet url and relative url
Date Tue, 23 Sep 2014 12:22:04 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 924269f11 -> f767314cd


[CXF-6020]: UrilInfo.getAbsolutePath() missing path separator between servlet url and relative
url


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

Branch: refs/heads/master
Commit: 65e1dc18524825872069cde98f870a9d68007a14
Parents: 6a90a1e
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Tue Sep 23 14:20:56 2014 +0200
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Tue Sep 23 14:20:56 2014 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java    | 3 +++
 .../test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java    | 5 +++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/65e1dc18/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
index 609eba1..46238cf 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
@@ -223,6 +223,9 @@ public class UriInfoImpl implements UriInfo {
         if (path.startsWith("/") && address.endsWith("/")) {
             address = address.substring(0, address.length() - 1);
         }
+        if (!path.isEmpty() && !path.startsWith("/") && !address.endsWith("/"))
{
+            address = address + "/";
+        }
         return address + path;
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/65e1dc18/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
index ef898fc..b2ddc1a 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
@@ -215,11 +215,16 @@ public class UriInfoImplTest extends Assert {
                                         null);
         assertEquals("Wrong absolute path", "http://localhost:8080/baz/bar", 
                      u.getAbsolutePath().toString());
+        
         u = new UriInfoImpl(mockMessage("http://localhost:8080/baz/", "/bar"),
                                         null);
         assertEquals("Wrong absolute path", "http://localhost:8080/baz/bar", 
                      u.getAbsolutePath().toString());
         
+        u = new UriInfoImpl(mockMessage("http://localhost:8080/baz", "bar"),
+                            null);
+        assertEquals("Wrong absolute path", "http://localhost:8080/baz/bar",
+                     u.getAbsolutePath().toString());
     }
     
     @Test


Mime
View raw message