-
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
upgrade spring-cloud-release from F to G, feign urlencode error #879
Comments
We've also experienced this. One thing that is not clear to me is that it would appear that not all URL encoding of params have stopped after upgrading from finchley.SR2 to greenwich.release, some characters still are. using finchley before the Using Greenwich, the I can use For the time being, I've modified my calling code to first URL encode any strings with potential for reserved characters before calling feign |
I'm looking into this. It appears that we are not applying path and query encoding correctly. |
i create a new
i hope feign official can solve this problem next version, thanks |
I would caution blindly encoding this way. Only some of the encoding is incorrect and your approach will double encode if a value is handled correctly. |
And one more important note, URLEncoder does not apply url encoding, it is used to encode form parameters and will incorrectly encode certain values. Use with caution. |
@kdavisk6 thanks! |
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`
PR #882 is now open. This PR attempts to correct this issue by making sure that each segment of the uri, be it the path or query, are correctly encoded based on the URI and URI Template specifications. With regards to the If your intention is to use If you are interested in more detail about where all this comes from, I invite you to look at RFC 3986 - Appendix A. It describes what characters are acceptable on each segment of the uri. |
* 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`
* 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`
upgrade spring-cloud-release from F to G, feign urlencode error
my app server code is
and app client code is
in spring-cloud-release F version
and i request
sessionKey
param isaaa+bbb
i check okhttp3 request log ,
sessionKey
param has been change toaaa%2B%bbb
and app server accept
sessionKey
param isaaa+bbb
in spring-cloud-release G version
and i request
sessionKey
param isaaa+bbb
i check okhttp3 request log ,
sessionKey
param has been change toaaa+bbb
(no encode)and app server accept
sessionKey
param isaaa bbb
how can i solve this problem?
thanks
The text was updated successfully, but these errors were encountered: