[CXF-7304] Step1 - using UTF-8 for the decoded destinations given that HttpServletRequest.getPathInfo() uses it by default too and the earlier encooding was used to support a case where an endpoint address has percent-encoded reserved chars which work fine with UTF-8 too
Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/c14363bd Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/c14363bd Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/c14363bd Branch: refs/heads/3.0.x-fixes Commit: c14363bda9df850433c5bb6eca4e14b86d4c536f Parents: 3042e7a Author: Sergey Beryozkin <[email protected]> Authored: Fri Mar 31 17:01:18 2017 +0100 Committer: Sergey Beryozkin <[email protected]> Committed: Fri Mar 31 17:25:40 2017 +0100 ---------------------------------------------------------------------- .../apache/cxf/transport/http/DestinationRegistryImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/c14363bd/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java ---------------------------------------------------------------------- diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java index 7d01b17..78f0803 100644 --- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java +++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java @@ -50,9 +50,9 @@ public class DestinationRegistryImpl implements DestinationRegistry { throw new RuntimeException("Already a destination on " + path); } try { - String path2 = URLDecoder.decode(path, "ISO-8859-1"); + String path2 = URLDecoder.decode(path, "UTF-8"); if (!path.equals(path2)) { - decodedDestinations.put(URLDecoder.decode(path, "ISO-8859-1"), destination); + decodedDestinations.put(path2, destination); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e); @@ -62,9 +62,9 @@ public class DestinationRegistryImpl implements DestinationRegistry { public synchronized void removeDestination(String path) { destinations.remove(path); try { - String path2 = URLDecoder.decode(path, "ISO-8859-1"); + String path2 = URLDecoder.decode(path, "UTF-8"); if (!path.equals(path2)) { - decodedDestinations.remove(URLDecoder.decode(path, "ISO-8859-1")); + decodedDestinations.remove(path2); } } catch (UnsupportedEncodingException e) { throw new RuntimeException("Unsupported Encoding", e);
