[jboss-jira] [JBoss JIRA] (WFLY-2916) getSerlvetPath() truncates path at the first semicolon
Rossen Stoyanchev (JIRA)
issues at jboss.org
Thu Feb 27 11:07:47 EST 2014
[ https://issues.jboss.org/browse/WFLY-2916?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12948711#comment-12948711 ]
Rossen Stoyanchev commented on WFLY-2916:
-----------------------------------------
These are the references I could find in the Servlet 3.1 spec:
Section 3.1:
bq. Path parameters that are part of a GET request (as defined by HTTP 1.1) are not exposed by these APIs. They must be parsed from the String values returned by the getRequestURI method or the getPathInfo method
Section 12.1:
bq. The path used for mapping to a servlet is the request URL from the request object minus the context path and the path parameters.
And the Javadoc for getServletPath():
{noformat}
* Returns the part of this request's URL that calls
* the servlet. This path starts with a "/" character
* and includes either the servlet name or a path to
* the servlet, but does not include any extra path
* information or a query string.
{noformat}
It does say path parameters should be removed but it doesn't say the path should be truncated. Truncating makes getServletPath useless.
Since the Servlet API still does not provide any way to find out how a Servlet is mapped, trying to determine the actual path to use for mapping purposes can be tricky and involves checking all of: getRequestUri(0, getServletPath(), and getPathInfo(). Truncation makes this determination even harder.
> getSerlvetPath() truncates path at the first semicolon
> ------------------------------------------------------
>
> Key: WFLY-2916
> URL: https://issues.jboss.org/browse/WFLY-2916
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Web (Undertow)
> Affects Versions: 8.0.0.Final
> Reporter: Rossen Stoyanchev
> Assignee: Stuart Douglas
>
> Given a URL path with path parameters (e.g. "/data/matrixvars;foo=bar1/multiple;foo=bar2"), depending on the Servlet mapping (e.g. with "/" the whole path after the context path is the servlet path), a call to getServletPath() is truncated after the first semicolon (e.g. "/data/matrixvars").
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list