tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject tomee git commit: treat / as a different path for cxf jaxrs resource handling integration - due to tomcat 8.5.6 upgrade
Date Wed, 12 Oct 2016 14:52:27 GMT
Repository: tomee
Updated Branches:
  refs/heads/master 4e1571d09 -> 823790b98


treat / as a different path for cxf jaxrs resource handling integration - due to tomcat 8.5.6
upgrade


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

Branch: refs/heads/master
Commit: 823790b98af391c721e1d4103fc94c6d688f1de5
Parents: 4e1571d
Author: rmannibucau <rmannibucau@apache.org>
Authored: Wed Oct 12 16:52:18 2016 +0200
Committer: rmannibucau <rmannibucau@apache.org>
Committed: Wed Oct 12 16:52:18 2016 +0200

----------------------------------------------------------------------
 ...AvoidConflictWithWebXmlWithNoResourceMatchingTest.java |  4 ++--
 .../apache/openejb/server/cxf/rs/CxfRsHttpListener.java   | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/823790b9/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/staticresources/AvoidConflictWithWebXmlWithNoResourceMatchingTest.java
----------------------------------------------------------------------
diff --git a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/staticresources/AvoidConflictWithWebXmlWithNoResourceMatchingTest.java
b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/staticresources/AvoidConflictWithWebXmlWithNoResourceMatchingTest.java
index dd8de77..8ebbf44 100644
--- a/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/staticresources/AvoidConflictWithWebXmlWithNoResourceMatchingTest.java
+++ b/arquillian/arquillian-tomee-tests/arquillian-tomee-jaxrs-tests/src/test/java/org/apache/openejb/arquillian/tests/jaxrs/staticresources/AvoidConflictWithWebXmlWithNoResourceMatchingTest.java
@@ -74,12 +74,12 @@ public class AvoidConflictWithWebXmlWithNoResourceMatchingTest {
     // but it would be not deterministic otherwise so not better
     @Test(expected = FileNotFoundException.class)
     public void jsp() throws IOException {
-        assertEquals("JSP 5", IO.slurp(new URL(url + "index.jsp")).trim());
+        IO.slurp(new URL(url + "index.jsp"));
     }
 
     @Test(expected = FileNotFoundException.class) // same as for jsp()
     public void home() throws IOException {
-        assertEquals("JSP 5", IO.slurp(url).trim());
+        IO.slurp(url);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/tomee/blob/823790b9/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
----------------------------------------------------------------------
diff --git a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
index e08ca05..7bede36 100644
--- a/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
+++ b/server/openejb-cxf-rs/src/main/java/org/apache/openejb/server/cxf/rs/CxfRsHttpListener.java
@@ -279,16 +279,16 @@ public class CxfRsHttpListener implements RsHttpListener {
                 pathInfo = pathInfo.substring(0, indexOf);
             }
         }
-        InputStream is = request.getServletContext().getResourceAsStream(pathInfo);
-        if (is == null && ("/".equals(pathInfo) || pathInfo.isEmpty())) {
+        if ("/".equals(pathInfo) || pathInfo.isEmpty()) { // root is redirected to welcomefiles
             for (final String n : welcomeFiles) {
-                is = request.getServletContext().getResourceAsStream(n);
+                final InputStream is = request.getServletContext().getResourceAsStream(n);
                 if (is != null) {
-                    break;
+                    return is;
                 }
             }
+            return null; // "/" resolves to an empty string otherwise, we need to avoid it
         }
-        return is;
+        return request.getServletContext().getResourceAsStream(pathInfo);
     }
 
     public boolean serveStaticContent(final HttpServletRequest request,


Mime
View raw message