cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject cxf git commit: [CXF-7210] Fix StringIndexOutOfBoundsException
Date Thu, 12 Jan 2017 05:54:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a81534d66 -> 1a8ae7afb


[CXF-7210] Fix StringIndexOutOfBoundsException

Signed-off-by: Sebastian Hoß <mail@shoss.de>


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

Branch: refs/heads/master
Commit: 1a8ae7afb254b77118aba543df2a720547a3ccf2
Parents: a81534d
Author: Sebastian Hoß <mail@shoss.de>
Authored: Wed Jan 11 13:39:31 2017 +0100
Committer: Sebastian Hoß <mail@shoss.de>
Committed: Wed Jan 11 13:39:31 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/AbstractClient.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1a8ae7af/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index b83989f..4a7d277 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -648,8 +648,10 @@ public abstract class AbstractClient implements Client {
         String reqURIPath = requestURI.getRawPath();
         
         UriBuilder builder = new UriBuilderImpl().uri(newBaseURI);
-        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();

-        builder.path(reqURIPath.equals(basePath) ? "" : reqURIPath.substring(basePath.length()));
+        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();
+        String relativePath = reqURIPath.equals(basePath) ? ""
+                : reqURIPath.startsWith(basePath) ? reqURIPath.substring(basePath.length())
: reqURIPath;
+        builder.path(relativePath);
         
         String newQuery = newBaseURI.getRawQuery();
         if (newQuery == null) {


Mime
View raw message