-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adding URI segment specific encoding #882
Adding URI segment specific encoding #882
Conversation
Fixes OpenFeign#879 URI encoding introduced in Feign 10.x was refactored to be more in line with URI and URI Template specifications respectively. One change was to ensure that certain reserved characters were not encoded incorrectly. The result was that path segment specific reserved characters were being preserved on the query string as well. This change updates the `UriTemplate` and `Expression` classes to recognize the segment of the URI that is being processed and apply the segment specific encoding correctly. One important change regarding the `+` sign. Per the URI specification, a `+` sign is allowed in both the path and query segments of a URI, however, handling of the symbol on the query can be inconsistent. In some legacy systems, the `+` is equivalent to the a space. Feign takes the approach of modern systems, where a `+` symbol should not reprsent a space and is explicitly encoded as `%2B` when found on a query string. If you wish to use `+` as a space, then use the literal ` ` character or encode the value directly as `%20`
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.
Lgtm
when the pr will be release? i hope to upgrade feign's version to fix this bug. thanks |
I'm in the process of cleaning up a few other things. I hope to have this released in the next week or two. |
@dragontree101 10.2.0 should be available now. |
We are using it with spring boot and it is not available yet. We have to override with explicit build number for open-feign. Thank you |
* Adding URI segment specific encoding Fixes #879 URI encoding introduced in Feign 10.x was refactored to be more in line with URI and URI Template specifications respectively. One change was to ensure that certain reserved characters were not encoded incorrectly. The result was that path segment specific reserved characters were being preserved on the query string as well. This change updates the `UriTemplate` and `Expression` classes to recognize the segment of the URI that is being processed and apply the segment specific encoding correctly. One important change regarding the `+` sign. Per the URI specification, a `+` sign is allowed in both the path and query segments of a URI, however, handling of the symbol on the query can be inconsistent. In some legacy systems, the `+` is equivalent to the a space. Feign takes the approach of modern systems, where a `+` symbol should not reprsent a space and is explicitly encoded as `%2B` when found on a query string. If you wish to use `+` as a space, then use the literal ` ` character or encode the value directly as `%20`
* Adding URI segment specific encoding Fixes #879 URI encoding introduced in Feign 10.x was refactored to be more in line with URI and URI Template specifications respectively. One change was to ensure that certain reserved characters were not encoded incorrectly. The result was that path segment specific reserved characters were being preserved on the query string as well. This change updates the `UriTemplate` and `Expression` classes to recognize the segment of the URI that is being processed and apply the segment specific encoding correctly. One important change regarding the `+` sign. Per the URI specification, a `+` sign is allowed in both the path and query segments of a URI, however, handling of the symbol on the query can be inconsistent. In some legacy systems, the `+` is equivalent to the a space. Feign takes the approach of modern systems, where a `+` symbol should not reprsent a space and is explicitly encoded as `%2B` when found on a query string. If you wish to use `+` as a space, then use the literal ` ` character or encode the value directly as `%20`
Fixes #879
URI encoding introduced in Feign 10.x was refactored to be more in line
with URI and URI Template specifications respectively. One change was to
ensure that certain reserved characters were not encoded incorrectly.
The result was that path segment specific reserved characters were being
preserved on the query string as well. This change updates the
UriTemplate
and
Expression
classes to recognize the segment of the URI that is being processedand apply the segment specific encoding correctly.
One important change regarding the
+
sign. Per the URI specification, a+
signis allowed in both the path and query segments of a URI, however, handling of
the symbol on the query can be inconsistent. In some legacy systems, the
+
isequivalent to the a space. Feign takes the approach of modern systems, where a
+
symbol should not represent a space and is explicitly encoded as%2B
whenfound on a query string.
If you wish to use
character or encode
+
as a space, then use the literalthe value directly as
%20