cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject git commit: [CXF-6020]: UrilInfo.getAbsolutePath() missing path separator between servlet url and relative url
Date Tue, 23 Sep 2014 12:30:41 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 52d650add -> f5a4c4826


[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/f5a4c482
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/f5a4c482
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/f5a4c482

Branch: refs/heads/2.7.x-fixes
Commit: f5a4c4826dc52690c75d3c8a73a1959644d240ae
Parents: 52d650a
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:27:44 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/f5a4c482/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 a3cdaf8..01b48cd 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
@@ -212,6 +212,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/f5a4c482/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 4b74c43..6674e70 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
@@ -56,11 +56,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