Skip to content

rewritePath filter double encodes URLs #3482

Closed
@jensmatw

Description

@jensmatw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions