Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9279176CE for ; Fri, 20 Mar 2015 22:57:40 +0000 (UTC) Received: (qmail 18395 invoked by uid 500); 20 Mar 2015 22:57:40 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 18334 invoked by uid 500); 20 Mar 2015 22:57:40 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 18325 invoked by uid 99); 20 Mar 2015 22:57:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Mar 2015 22:57:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A04B5E112F; Fri, 20 Mar 2015 22:57:40 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Message-Id: <04f81247fe134b89b9998a2c2000b787@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: cxf git commit: [CXF-6302] Initial support for URL-encoded RS destinations Date: Fri, 20 Mar 2015 22:57:40 +0000 (UTC) Repository: cxf Updated Branches: refs/heads/3.0.x-fixes e94da32fb -> 42f10320f [CXF-6302] Initial support for URL-encoded RS destinations Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/42f10320 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/42f10320 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/42f10320 Branch: refs/heads/3.0.x-fixes Commit: 42f10320f728340e5c2a266c7a2d034897523472 Parents: e94da32 Author: Sergey Beryozkin Authored: Fri Mar 20 22:56:17 2015 +0000 Committer: Sergey Beryozkin Committed: Fri Mar 20 22:57:21 2015 +0000 ---------------------------------------------------------------------- .../transport/http/DestinationRegistryImpl.java | 17 ++++++++++++----- .../jaxrs/JAXRSClientServerSpringBookTest.java | 4 ++-- .../src/test/resources/jaxrs/WEB-INF/beans.xml | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/42f10320/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 edfe5c2..539ba6f 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 @@ -85,9 +85,19 @@ public class DestinationRegistryImpl implements DestinationRegistry { } public AbstractHTTPDestination checkRestfulRequest(String address) { + AbstractHTTPDestination ret = getRestfulDestination(getDestinationsPaths(), address); + if (ret == null) { + ret = getRestfulDestination(decodedDestinations.keySet(), address); + } + if (ret != null && ret.getMessageObserver() == null) { + return null; + } + return ret; + } + private AbstractHTTPDestination getRestfulDestination(Set destPaths, String address) { int len = -1; AbstractHTTPDestination ret = null; - for (String path : getDestinationsPaths()) { + for (String path : destPaths) { String thePath = path.length() > 1 && path.endsWith(SLASH) ? path.substring(0, path.length() - 1) : path; if ((address.equals(thePath) @@ -99,10 +109,7 @@ public class DestinationRegistryImpl implements DestinationRegistry { len = path.length(); } } - if (ret != null && ret.getMessageObserver() == null) { - return null; - } - return ret; + return ret; } public Collection getDestinations() { http://git-wip-us.apache.org/repos/asf/cxf/blob/42f10320/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java index c4df434..72afb43 100644 --- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java +++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java @@ -97,7 +97,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest @Test public void testGetBookWebEx4() throws Exception { - final String address = "http://localhost:" + PORT + "/the/thebooks3/bookstore/books/webex2"; + final String address = "http://localhost:" + PORT + "/the/thebooks%203/bookstore/books/webex2"; doTestGetBookWebEx(address); } @@ -377,7 +377,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest @Test public void testGetBookByUriInfo2() throws Exception { String endpointAddress = - "http://localhost:" + PORT + "/the/thebooks3/bookstore/bookinfo?" + "http://localhost:" + PORT + "/the/thebooks%203/bookstore/bookinfo?" + "param1=12¶m2=3"; getBook(endpointAddress, "resources/expected_get_book123json.txt"); } http://git-wip-us.apache.org/repos/asf/cxf/blob/42f10320/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml ---------------------------------------------------------------------- diff --git a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml index f1acd6d..ab7c78f 100644 --- a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml +++ b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml @@ -55,7 +55,7 @@ - +