Why feign performs urlencode twice on the query parameter values?
See original GitHub issueFeign encodes a query string twice that : finally becomes %253A and the correct result should be %3A.
First encoding happens when creating a RequestTemplate
(ReflectiveFeign.java:213)
RequestTemplate template = resolve(argv, mutable, varBuilder);
Second encoding happens when constructing a Request
(SynchronousMethodHandler.java:88)
Request request = targetRequest(template);
Though one of the RequestTemplate’s query() methods accepts a boolean parameter to determine whether to encode the query parameter values, the default value of this boolean is false and there is no way to change its value.
Finally, I have to write a RequestInterceptor
to decode the query parameter values between the two encodings.
Why would feign do two encodings on query parameter values? Is it a bug or did I miss something?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (2 by maintainers)
@kgym here is my quick workaround (ugly but works):
Duplicate of #662