Repository navigation
Description
Rossen Stoyanchev opened SPR-15640 and commented
Status Quo
By default Spring MVC decodes the path before using it for request mapping purposes. In turn that means @RequestMapping patterns can be expressed in undecoded form. This works just fine until the path contains encoded characters with reserved URI meaning such as a "/" or ";" where decoding alters the structure of the path. Applications can configure a UrlPathHelper that does not decode the URL path which works fine and in that case URI variables are automatically decoded before being injected into a controller with @PathVariable. However the literal parts of mapping patterns must now be expressed with encoded characters.
WebFlux
In WebFlux the URL path will not be decoded for request mapping purposes. Patterns can still be expressed in undecoded form but will be encoded as UTF-8 and stored that way to match to the encoded URL path of incoming requests. This eliminates the need to specify whether the path should be decoded or not along exposure to issues that can arise from decoding the path.
Spring MVC
Since support for encoding patterns will likely be in the new PathPatternParser - used by default in WebFlux, this will be a natural fit for WebFlux. The goal for Spring MVC is for applications to be able to achieve the same affect by switching to use the PathPatternParser.
Sub-tasks:
- Update Spring MVC after PathPatternParser changes to encode patterns [SPR-15650] #20209 Update Spring MVC after PathPatternParser changes to encode patterns
Issue Links:
- Expose structured request path from ServerHttpRequest in WebFlux [SPR-15648] #20207 Expose structured request path from ServerHttpRequest in WebFlux
- Review path matching options and defaults in the new path matching algorithms [SPR-14993] #19559 Review path matching options and defaults in the new path matching algorithms
- Favor query parameters for content negotiation in WebFlux [SPR-15639] #20198 Favor query parameters for content negotiation in WebFlux
Activity