-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Gateway MVC forward request but with decoded parameters (%2B becomes +) #3346
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
Comments
|
Is there any news on this one? I faced the same issue where my parameter The definition of the route is quite simple:
When debugging, it look like this reply point the root cause, but I still have it in spring-cloud 4.1.6 Is there, at least, any workaround? I'm a bit confused that such basic core feature of a gateway seems to not work when migrate to the new version. |
This is still bug in 4.2.x |
Describe the bug
I use the following version of Spring Cloud Gateway MVC to forward request.
org.springframework.cloud
spring-cloud-starter-gateway-mvc
4.1.2
same description as #3272
a bug in the code of the ProxyExchangeHandlerFunction class.
This is based on serverRequest.uri() to determine whether the URL has been encoded, but when constructing a new URL, the query parameter is replaced with serverRequest.params(). The reality is that serverRequest.uri() is encoded by the URI, but serverRequest.params() is not encoded.
Sample
The url as http://localhost:8083/test?q=name%3Atestname%2BState%3AFailed
In Gateway MVC will forward the rquest as
http://localhost:8083/test?q=name:testname+State:Failed, when the corrsponding service receive the request,
then + becomes space character.
For the UriComponentsBuilder, it will use HierarchicalUriComponents internally, is this related to below issue?
spring-projects/spring-framework#23025
The text was updated successfully, but these errors were encountered: