spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Why the header processing related to X-FORWARD is to modify the header value instead of multiple values.

Open sodaRyCN opened this issue 3 years ago • 0 comments

https://github.com/spring-cloud/spring-cloud-gateway/blob/b8dbdc1fbff8e232c4f21f5832f6d506580a2dcb/spring-cloud-gateway-webflux/src/main/java/org/springframework/cloud/gateway/webflux/ProxyExchange.java#L411

why not like below code: private void appendXForwarded(URI uri) { headers.add("x-forwarded-host", uri.getHost()); headers.add("x-forwarded-proto", uri.getScheme()); }

With the current scg method, the downstream must know that the X-Forward related header is appended to the first value using "," instead of having multiple values ​​like other headers.

sodaRyCN avatar May 26 '22 10:05 sodaRyCN