-
Bug
-
Resolution: Done
-
Major
-
2.2.4.Final
-
None
Given a servlet registered to "/" and ".ext", requests which attempt to read getHttpServletMapping result in StringIndexOutOfBoundsException attempting to substring an empty string.
The problem is the current implementation expects the matched portion to match the uri, however it doesn't contain the trailing component when an extension is matched.
Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -5, length 0 at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319) at java.base/java.lang.String.substring(String.java:1874) at io.undertow.servlet.spec.HttpServletRequestImpl.getHttpServletMapping(HttpServletRequestImpl.java:258) at org.springframework.web.util.UrlPathHelper$Servlet4Delegate.skipServletPathDetermination(UrlPathHelper.java:780) at org.springframework.web.util.UrlPathHelper.skipServletPathDetermination(UrlPathHelper.java:272) at org.springframework.web.util.UrlPathHelper.getLookupPathForRequest(UrlPathHelper.java:251) at org.springframework.web.util.UrlPathHelper.resolveAndCacheLookupPath(UrlPathHelper.java:200)
- incorporates
-
UNDERTOW-1866 NPE in HttpServletRequest#getHttpServletMapping()
- Resolved