Closed nefsir closed 4 years ago
@rstoyanchev can you comment. I'm a bit confused as to what spring cloud gateway needs to do.
Given a request with path of "/service1/something" where contextPath is "/service1", if the path is mutated to "/service2/something-else" without also updating the contextPath, that leaves the two in an inconsistent state. The contextPath needs to somehow be updated accordingly or reset to "".
How come I don't see this in the integration tests?
@nefsir do you have spring.webflux.base-path
set?
If so I believe this fits under #1935. There is currently no support for base-path in gateway.
How come I don't see this in the integration tests?
I'm not sure and I don't know the exact details of the scenario, but the error clearly indicates that the request path was mutated and it no longer matches the contextPath which might have come in through "Forwarded" type headers and set in the ForwardedHeaderTransformer
.
I did write a small test using spring.webflux.base-path
and that is the only time this error appears. Closing as a duplicate of #1935.
After upgrading from SpringBoot 2.3.1.RELEASE to 2.3.2.RELEASE I've faced issue connected with this commit: c4326cb
When using RewritePath filter in Spring Cloud Gateway:
- RewritePath=/service1(?<segment>/?.*), /service2$\{segment}
Im getting:
Probably because of mentioned commit both became incompatible.
Originally the issue was posted on spring framework's github: https://github.com/spring-projects/spring-framework/issues/25994
Proposed resolution is: https://github.com/spring-projects/spring-framework/issues/25994#issuecomment-718790829