Thibaud Lepretre opened SPR-14376 and commented
With latest ForwardedHeaderFilter executed on Spring application that is using context-path
server.context-path: /bar
If X-Forwarded-Prefix: /foo is present the following url http://blabla.com/bar/oauth/authorize will be converted to http://blabla.com/foo/oauth/authorize
However with following architecture (1) Reverse proxy SSL with context path /foo, (2) Zuul without context path and (3) Microservice BAR with context path /bar: rendering request will not work because http://blabla.com/foo/oauth/authorize will be 404.
Expected result should be http://blabla.com/foo/bar/oauth/authorize.
However I'm aware that for some other use cases context-path should be replaced and not prepended (like I wish). So the issue is debatable.
Possible solutions:
- Clearly document that
X-Forwarded-Prefix will not really prefix but replace the existing context-path
- Add option to choose strategy between prepending or replacing
- If you consider it as a bug, just prepend.
For example Spring cloud netflix prepends X-Forwarded-Prefix during Zuul filtering https://github.com/spring-cloud/spring-cloud-netflix/pull/994/files#diff-8a3a3948fd59a02ea4234d960437c3a0R120
Affects: 4.3 GA
Issue Links:
Thibaud Lepretre opened SPR-14376 and commented
With latest
ForwardedHeaderFilterexecuted on Spring application that is using context-pathIf
X-Forwarded-Prefix: /foois present the following url http://blabla.com/bar/oauth/authorize will be converted to http://blabla.com/foo/oauth/authorizeHowever with following architecture
(1) Reverse proxy SSLwith context path/foo,(2) Zuul without context pathand(3) Microservice BARwith context path/bar: rendering request will not work because http://blabla.com/foo/oauth/authorize will be404.Expected result should be http://blabla.com/foo/bar/oauth/authorize.
However I'm aware that for some other use cases context-path should be replaced and not prepended (like I wish). So the issue is debatable.
Possible solutions:
X-Forwarded-Prefixwill not really prefix but replace the existing context-pathFor example Spring cloud netflix prepends
X-Forwarded-PrefixduringZuulfiltering https://github.com/spring-cloud/spring-cloud-netflix/pull/994/files#diff-8a3a3948fd59a02ea4234d960437c3a0R120Affects: 4.3 GA
Issue Links: