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

Parse request path only once during routing [SPR-15397] #19960

Closed
spring-projects-issues opened this issue Mar 29, 2017 · 3 comments
Closed

Parse request path only once during routing [SPR-15397] #19960

spring-projects-issues opened this issue Mar 29, 2017 · 3 comments
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 Mar 29, 2017

Brian Clozel opened SPR-15397 and commented

Since the introduction of PathPatternParser in #19112, the WebFlux framework is using it within the ParsingPatchMatcher to match incoming requests against route patterns.

Attempts to integrate the PathPatternParser directly and leverage its full potential were made in the previous milestone but were reverted in fa4202f, after we fully understood that this strategy could be improved in several ways:

  • incoming requests should be parsed once at the beginning of the request pipeline, at the HandlerMapping level; their path should be parsed to extract the path, path parameters and file extension informations, and more if necessary
  • this "parsed request" information should be made available to the rest of the request pipeline, by using an exchange attribute
  • the HttpRequestPathHelper does not need to leak in multiple places anymore

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Rob Winch commented

I noticed that LookupPath returns a String and it is extracted based on anything after a ;.

However, the path /1;a=b/2;c=d/3 provides path variables of a=b and c=d which is multiple values and probably not compatible with the String return type. You can also see that the path variables are from the ; to the next path separator / and each path segment can contain path variables.

I'm going to reopen this ticket so this can be addressed.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Equivalent code used in Spring MVC.

@spring-projects-issues
Copy link
Collaborator Author

Brian Clozel commented

Good catch, thanks!

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