'Spring Cloud Gateway - RewritePath not keeping # (URI fragment)
I'm working with Spring Cloud Gateway (Hoxton.SR6 version) and Java 11, and I have problems redirecting urls containing a "#" :
For example '{host}/api/v1/foo#bar' is redirected to /foo, while I would like to keep the '#bar' part too.
Here is my configuration:
routes:
- id: apiId
uri: https://foo.free.beeceptor.com
predicates:
- Path=/api/v1/**
filters:
- RewritePath=/api/v1/(?<segment>/?.*), /$\{segment}
However when I test the regex, the "#" character is supposed to stay :
screenshot regex101
Edit : In fact the problem does not come from the RewritePath filter, but before : When the request arrives, the "uri fragments" are already deleted ... I'll keep looking
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
