-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Don't URL encode fragment identifiers #937
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
Conversation
kdavisk6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. We may need to keep an eye out for any exotic use cases where the fragment may contain characters outside of the pchar definition, but I think this will work just fine for now. Thanks for helping out!
|
Sorry to chime in, but I think it's a wrong behavier! Fragment is purely client-side, and the browser sends the url without fragment. Nginx will strip off the fragment, and curl does this so, and more. I think we could choose one of the following ways:
I prefer to 3, keep as it is. And user should be responsible for their input. |
|
We've been using OkHttp, which doesn't send the fragment either according to the documentation. The same can probably be said of every other underlying HTTP client that Feign delegates to - meaning this commit doesn't actually conflict with RFC3986 as you suggest. Our use case is that we automatically generate Feign clients from Swagger files with the help of openapi-generator. Our partner uses fragments in some of their paths, and we'd rather not manually strip out them out every time they update their documentation. Whether Feign actually keeps the fragment is not that important to us. The important thing is that Feign properly handles valid URLs, by not URL encoding the hash sign and putting the fragment before the query. What are your thoughts @kdavisk6? |
|
Agreed. It is our job to process and prepare the request based on the specification provided by the Target interface and it's underlying Contract, and to present consistent, repeatable behavior when doing so. In short, as @rejierd has stated, if a user specifies a fragment on the uri template, we need to ensure that we process it as outlined in RFC 6570 and produce a valid URL, which Feign was not doing properly in this case. |
Fixes #936 This is a super simple fix to illustrate the issue. If a different solution is preferred, then I'm open for suggestions of course.
Fixes #936 This is a super simple fix to illustrate the issue. If a different solution is preferred, then I'm open for suggestions of course.
Fixes #936
This is a super simple fix to illustrate the issue.
If a different solution is preferred, then I'm open for suggestions of course.