commit | 32abaafee595bea3bcf20a0e318f4ee018af215d | [log] [tgz] |
---|---|---|
author | Sten Roger Sandvik <srs@apache.org> | Tue Oct 06 21:39:54 2009 +0000 |
committer | Sten Roger Sandvik <srs@apache.org> | Tue Oct 06 21:39:54 2009 +0000 |
tree | a2272933069cff8b3c092cfe22e919dfa4330f98 | |
parent | ad4fab3898f8dece6f2d5892e8d65e424307f30a [diff] |
FELIX-1713: getPathInfo() fix. Stripped everyting away after first ; (semicolon). git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@822522 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 8604960..5674587 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
@@ -66,9 +66,9 @@ pathInfo = pathInfo.replaceAll("[/]{2,}", "/"); pathInfo = pathInfo.substring(servletPathLength); - int qmarkPos = pathInfo.indexOf('?'); - if (qmarkPos > 0) { - pathInfo = pathInfo.substring(0, qmarkPos); + int scPos = pathInfo.indexOf(';'); + if (scPos > 0) { + pathInfo = pathInfo.substring(0, scPos); } if ("".equals(pathInfo) && servletPathLength != 0) {
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 5c87599..6e7808c 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
@@ -37,7 +37,7 @@ superReq = Mockito.mock(HttpServletRequest.class); Mockito.when(superReq.getContextPath()).thenReturn("/mycontext"); - Mockito.when(superReq.getRequestURI()).thenReturn("/mycontext/myservlet/request/to/resource?param=value"); + Mockito.when(superReq.getRequestURI()).thenReturn("/mycontext/myservlet/request/to/resource;jsession=123"); this.req2 = new ServletHandlerRequest(superReq, "/myservlet"); }