commit | eff892e73ef99bdc69016fa4f2de5e6372c262c2 | [log] [tgz] |
---|---|---|
author | Sten Roger Sandvik <srs@apache.org> | Mon Nov 16 23:38:02 2009 +0000 |
committer | Sten Roger Sandvik <srs@apache.org> | Mon Nov 16 23:38:02 2009 +0000 |
tree | 3d33d7230182fbd9aa55b543ffcc9b43d0279797 | |
parent | 86405c964c95c4e94365b30e3d8ee4243baa774e [diff] |
FELIX-1863: Applied patch from Justin Edelson git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@881056 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequest.java b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequest.java index 5674587..ab00a18 100644 --- a/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequest.java +++ b/http/base/src/main/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequest.java
@@ -53,6 +53,9 @@ @Override public String getServletPath() { + if ("/".equals(this.alias)) { + return ""; + } return this.alias; }
diff --git a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequestTest.java b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequestTest.java index 6e7808c..151bf00 100644 --- a/http/base/src/test/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequestTest.java +++ b/http/base/src/test/java/org/apache/felix/http/base/internal/handler/ServletHandlerRequestTest.java
@@ -47,4 +47,11 @@ Assert.assertEquals("/request/to/resource", this.req1.getPathInfo()); Assert.assertEquals("/request/to/resource", this.req2.getPathInfo()); } + + @Test + public void testServletPath() + { + Assert.assertEquals("", this.req1.getServletPath()); + Assert.assertEquals("/myservlet", this.req2.getServletPath()); + } }