-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #11815 HttpServletMapping #11829
Fix #11815 HttpServletMapping #11829
Conversation
Implemented a test that uses the examples from the javadoc Fixed the matchValue for PREFIX matches
I'm inclined not to port back to EE10 as nobody has complained and we passed the TCK. |
@janbartel @lachlan-roberts the CI failures are just the asciidoc stuff... so can I get a review please. |
…1.x/11815/HttpServletMapping
@janbartel @lachlan-roberts nudge! |
_pathInfo = matchedPath != null | ||
? matchedPath.getPathInfo() | ||
: _servletPath.length() == pathInContext.length() ? null : pathInContext.substring(_servletPath.length()); | ||
_matchValue = _pathInfo == null ? "" : _pathInfo.startsWith("/") ? _pathInfo.substring(1) : _pathInfo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this using _pathInfo
and not pathInContext
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec requires that for in a context "/ctx", with a pattern "/foo/*" then for a request to "/ctx/foo/info", the contextPath
will be "/ctx", the servletPath
will be "/foo" and the pathInfo
"/info". We had previously implemented that the match value was based on the servletPath
(so "foo"), but it needs to be based on the part that matched the *, i.e. the pathInfo
without the leading slash (so "info").
The path in context is "/foo/info", so that is servletPath
+ pathInfo
and is not what we want for the matchValue.
Implemented a test that uses the examples from the javadoc Fixed the matchValue for PREFIX matches