-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
I'm currently using spring-cloud gateway behind another reverse proxy. Both strip a path component and both set an X-Forwarded-Prefix header accordingly. This leads to spring-cloud-gateway appending it's path component to the existing X-Forward-Prefix Header with both components being separated by a comma.
Client ---/a/b/c---> Proxy1 ---- /b/c -----> Proxy2 ----- /c -----> Some Service
X-Forwarded-Prefix: /a X-Forwarded-Prefix: /a,/b
This breaks Spring's ForwardedHeaderFilter, since it just uses the header's content to prefix the request path. I also couldn't find any other source describing this behaviour for X-Forwarded-Prefix - MDN describes this for X-Forwarded-For.
Some form of compatibility with Spring's ForwardedHeaderFilter (and probably other implementations which assume they can just prefix a path with the contents of X-Forwarded-Prefix would be preferable to the current behavior.