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

MvcUriComponentsBuilder drops trailing slash from @RequestMapping [SPR-12742] #17339

Closed
spring-issuemaster opened this issue Feb 21, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Feb 21, 2015

Christian Rudolph opened SPR-12742 and commented

UriComponentsBuilder#uriComponents drops trailing slashes when constructing a UriComponentsBuilder from given UriComponents that have a trailing slash.

This is an issue when using MvcUriComponentsBuilder to fetch a controller method's uri that ends on a slash. The constructed uri doesn't point to the correct location.


Affects: 4.1.5

Referenced from: commits 0e7eecf

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 23, 2015

Rossen Stoyanchev commented

Currently UriComponentsBuilder.uriComponents copies what it needs from the given UriComponents instance. Looks it would make more sense to be the other way around, i.e. UriComponents knows best how to populate a UriComponentsBuilder.

We can add a method to UriComponents that sets the components of UriComponentsBuilder. That will make UriComponentsBuilder.uriComponents very short and simple getting rid of the instanceof check for OpaqueUriComponents and also giving HierarchicalUriComponents a chance to reflect the exact path which could be a mix of "full path" and "path segment" values.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 20, 2015

Rossen Stoyanchev commented

Modified title ("was: UriComponentsBuilder.uriComponents drops trailing slashes") to better reflect the actual end effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.