-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Gaurav Khanna opened SPR-12372 and commented
If we map the DispatcherServlet as the default servlet as in:
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
And the controller has the request mapping as in:
@RequestMapping
("/controller/**")
And if we have a GET request with two trailing slashes as in:
http://xxx.xxx/app/controller/REQ// [URI 1]
Then the default servlet (spring) is not able to find a mapping for it and we get a 404. However if we have a single trailing "/" then it works. Or if have multiple slashes anywhere in the REQ (together or separated) that works fine too. For instance:
http://xxx.xxx/app/controller/REQ//A [URI 2] [Here "A" could be just one character except the "/"]
Also, if we make the DispatcherServlet map to "/*" then two or more trailing "/" slashes work as well.
Should the default servlet (spring) not map URI 1 above without the wildcard in web.xml?
Affects: 3.2.1
Issue Links:
- 404 error with double slash in context path [SPR-10467] #15100 404 error with double slash in context path ("is duplicated by")
- RequestMapping maps double-slashes to single slashes [SPR-11220] #15845 RequestMapping maps double-slashes to single slashes
Referenced from: commits e02719e
0 votes, 5 watchers