spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

rewritePath filter double encodes URLs

Open jensmatw opened this issue 1 year ago • 0 comments

Describe the bug The rewritePath filter encodes URLs twice because it reads "rawPath" which includes an encoded form of the URI and after that, using UriComponentsBuilder which encodes it again.

Sample Just use the rewritePath filter on any route and try to use a url containing a space (%20), the result will be, that downstream service is called with %2520.

I have added a PR to solve the issue. I see several other invocations of "getRawPath" in the same class, maybe they need a similar fix, but I'm not using them so haven't tested them yet.

jensmatw avatar Jul 30 '24 12:07 jensmatw