cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject cxf git commit: [CXF-6853]:Support encoded value in @ApplicationPath
Date Wed, 30 Mar 2016 13:08:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes af303b6ee -> fd33546e4


[CXF-6853]:Support encoded value in @ApplicationPath


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

Branch: refs/heads/3.0.x-fixes
Commit: fd33546e44aa148f77b88094d8dfafdbe3640f9c
Parents: af303b6
Author: Jim Ma <ema@apache.org>
Authored: Wed Mar 30 20:57:24 2016 +0800
Committer: Jim Ma <ema@apache.org>
Committed: Wed Mar 30 21:07:56 2016 +0800

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java   | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/fd33546e/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
index 61664b4..0fedc24 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/HttpUtils.java
@@ -22,6 +22,7 @@ package org.apache.cxf.jaxrs.utils;
 import java.io.UnsupportedEncodingException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.net.URLDecoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -498,6 +499,15 @@ public final class HttpUtils {
     public static String getPathToMatch(String path, String address, boolean addSlash) {
         
         int ind = path.indexOf(address);
+        try {
+            String decodeAddr = URLDecoder.decode(address, "UTF-8");
+            if (ind == -1 && !address.equals(decodeAddr)) {
+                address = decodeAddr;
+                ind = path.indexOf(address);
+            }
+        } catch (UnsupportedEncodingException e) {
+            //
+        }
         if (ind == -1 && address.equals(path + "/")) {
             path += "/";
             ind = 0;


Mime
View raw message