-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Rossen Stoyanchev opened SPR-8474 and commented
With suffix pattern matching "/users" also matches to "/users.*". This is useful for content type negotiation - e.g. /users.xml, /users.pdf - but can lead to ambiguity when extracting URI template variables.
For example given "/users/{user}":
- "/users/1.json" should extract "1"
- "/users/john.j.joe" should extract "john.j.joe"
Currently the above cannot be supported at the same time. You can only turn suffix pattern matching on or off. A simple solution could look for a single "." only but then this would be impossible:
"/users/john.j.joe.json" should extract "john.j.joe"
Ideally the PatternsRequestCondition should be able to decide if the suffix represents a known file extension (.xml, .json) similar to how the ContentNegotiatingViewResolver is configured today.
This should become possible as part of the content negotiation improvements planned for Spring 3.2 (#13057).
Affects: 3.1 M2
This issue is a sub-task of #13057
Issue Links:
- Allow valid file extension paths for content negotiation to be specified [SPR-7632] #12288 Allow valid file extension paths for content negotiation to be specified ("duplicates")
- 404 error when working with .htm servlet-mapping [SPR-10061] #14694 404 error when working with .htm servlet-mapping
Referenced from: commits 4fd7645, 9cc4bd8
2 votes, 3 watchers