-
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
Query params will be encoded twice in newest Version 10.7.2 #1156
Comments
To better help and understand your issue, can you please provide your Feign interface definition and a simple working example? |
I hope this demo helps. public class Demo {
public interface Echo {
@RequestLine("GET /get?someUrl={value}")
String sampleCall(@Param("value") String value);
}
public static void main(String[] args){
Echo echo = Feign.builder()
.logLevel(Logger.Level.FULL)
.logger(new Logger.ErrorLogger())
.target(Echo.class, "https://postman-echo.com");
System.out.println(echo.sampleCall("http://www.google.de"));
}
} generated url in 10.7.2 : |
Fixes OpenFeign#1156 Collection Format was encoding query string values unnecessarily due to changes introduced in OpenFeign#1138 and OpenFeign#1139 that encode template values before appending them to the query string. In addition, `decodeSlash` flags that were accidentally removed, have been restored in QueryTemplate.
I found the issue. The example above after this change will now be: public interface Echo {
@RequestLine("GET /get?someUrl={value}")
String sampleCall(@Param("value") String value);
}
https://postman-echo.com/get?someUrl=http%3A//www.google.de public interface Echo {
@RequestLine("GET /get?someUrl={value}", decodeSlash=false)
String sampleCall(@Param("value") String value);
}
https://postman-echo.com/get?someUrl=http%3A%2F%2Fwww.google.de |
Fixes OpenFeign#1156 Collection Format was encoding query string values unnecessarily due to changes introduced in OpenFeign#1138 and OpenFeign#1139 that encode template values before appending them to the query string. In addition, `decodeSlash` flags that were accidentally removed, have been restored in QueryTemplate.
Fixes #1156 Collection Format was encoding query string values unnecessarily due to changes introduced in #1138 and #1139 that encode template values before appending them to the query string. In addition, `decodeSlash` flags that were accidentally removed, have been restored in QueryTemplate. * Restoring decodeSlash in QueryTemplate * Correcting Readme with regards to decodeSlash usage
Fixes #1156 Collection Format was encoding query string values unnecessarily due to changes introduced in #1138 and #1139 that encode template values before appending them to the query string. In addition, `decodeSlash` flags that were accidentally removed, have been restored in QueryTemplate. * Restoring decodeSlash in QueryTemplate * Correcting Readme with regards to decodeSlash usage
Fixes #1156 Collection Format was encoding query string values unnecessarily due to changes introduced in #1138 and #1139 that encode template values before appending them to the query string. In addition, `decodeSlash` flags that were accidentally removed, have been restored in QueryTemplate. * Restoring decodeSlash in QueryTemplate * Correcting Readme with regards to decodeSlash usage
After the release of version 10.7.2, values of query params in the expression will be encoded twice.
Following URL will be generated when I provide the string
:§$%&/()=
as parameter value:https://www.abc.com/foo?bar=%253A%25C2%25A7%2524%2525%2526%2F%2528%2529%253D
When I decode the URL I get following result:
https://www.abc.com/foo?bar=%3A%C2%A7%24%25%26/%28%29%3D
And exactly this result shows a URL that is encoded, so therefore when I decode the result again, I get following string:
https://www.abc.com/foo?bar=:§$%&/()=
Unfortunatly, changing the HTTP client did not help. Am I the only one who got this problem?
The text was updated successfully, but these errors were encountered: