Skip to content
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

Use undecoded path for request mapping in WebFlux [SPR-15640] #20199

Closed
spring-projects-issues opened this issue Jun 7, 2017 · 0 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 7, 2017

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:

Issue Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants