cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Using UriBuilder to deal with duplicate forward slashes
Date Wed, 14 Sep 2016 13:28:13 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 5072be969 -> 4aa035327


Using UriBuilder to deal with duplicate forward slashes


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

Branch: refs/heads/3.1.x-fixes
Commit: 4aa03532795379b702249e881a3bf027062a797c
Parents: 5072be9
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Sep 14 14:26:52 2016 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Sep 14 14:27:53 2016 +0100

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java    | 2 ++
 .../rs/security/oauth2/services/AuthorizationMetadataService.java | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4aa03532/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
b/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
index d1fb1f5..030548f 100644
--- a/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
+++ b/rt/rs/extensions/json-basic/src/main/java/org/apache/cxf/jaxrs/json/basic/JsonMapObjectReaderWriter.java
@@ -71,12 +71,14 @@ public class JsonMapObjectReaderWriter {
 
     protected void toJsonInternal(Output out, Map<String, Object> map) {
         out.append("{");
+        formatIfNeeded(out);
         for (Iterator<Map.Entry<String, Object>> it = map.entrySet().iterator();
it.hasNext();) {
             Map.Entry<String, Object> entry = it.next();
             out.append("\"").append(entry.getKey()).append("\"");
             out.append(":");
             toJsonInternal(out, entry.getValue(), it.hasNext());
         }
+        formatIfNeeded(out);
         out.append("}");
     }
     

http://git-wip-us.apache.org/repos/asf/cxf/blob/4aa03532/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationMetadataService.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationMetadataService.java
b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationMetadataService.java
index 97c7a53..7e7d05b 100644
--- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationMetadataService.java
+++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/services/AuthorizationMetadataService.java
@@ -25,6 +25,7 @@ import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
+import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.cxf.jaxrs.json.basic.JsonMapObjectReaderWriter;
@@ -76,7 +77,7 @@ public class AuthorizationMetadataService {
         if (endpointAddress.startsWith("https")) {
             return endpointAddress;
         } else {
-            return baseUri + endpointAddress; 
+            return UriBuilder.fromUri(baseUri).path(endpointAddress).build().toString();

         }
     }
 


Mime
View raw message