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

RestTemplate drops trailing / from request URI [SPR-15201] #19765

Closed
spring-projects-issues opened this issue Jan 28, 2017 · 1 comment
Closed

RestTemplate drops trailing / from request URI [SPR-15201] #19765

spring-projects-issues opened this issue Jan 28, 2017 · 1 comment
Assignees
Labels
in: web type: bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jan 28, 2017

Andy Wilkinson opened SPR-15201 and commented

In the latest 5.0.0 snapshots, RestTemplate has started dropping a trailing / when the URI is passed in as a String. For example, a request to http://localhost:8080/spring/ will become a request to http://localhost:8080/spring.

The loss of the / happens during variable expansion so I think that this commit may have introduced the problem. A workaround is to pass a URI into RestTemplate rather than a String so that expansion does not occur.


Affects: 5.0 M5

Issue Links:

  • #19691 Provide convenient ways to specify query parameters to WebClient

Referenced from: commits b487ed6

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 28, 2017

Rossen Stoyanchev commented

Indeed this is related to the commit introducing UriBuilderFactory along with the commit deprecating the DefaultUriTemplateHandler and the change in the default from not parsing to parsing the path of the URI template into path segments.

I have fixed the issue and also added a property to the new DefaultUriBuilderFactory which is the replacement for DefaultUriTemplateHandler but I am hoping we can keep the same defaults across the RestTemplate and the WebClient and I think the should be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web type: bug
Projects
None yet
Development

No branches or pull requests

2 participants