servletPath consistency for wrapped plugin HttpRequest.

HttpServletRequest.getServletPath() should not
include the contextPath part: this semantics
needs to be preserved for Http plugins in order
to avoid inconsistencies in plugged Http Services.

i.e. GitBlit RSS syndication filter was not working
properly because of context path found multiple times
in Servlet path.

Change-Id: I7d6cd584b72b1e6f91ad5c53a45307f9dcdb6b8c
Signed-off-by: Luca Milanesio <luca.milanesio@gmail.com>
This commit is contained in:
Luca Milanesio
2012-12-02 08:44:15 +00:00
parent 213d5ec4cd
commit 1be0610696

View File

@@ -602,7 +602,8 @@ class HttpPluginServlet extends HttpServlet
@Override
public String getServletPath() {
return ((HttpServletRequest) getRequest()).getRequestURI();
return ((HttpServletRequest) getRequest()).getRequestURI().substring(
contextPath.length());
}
}
}