spring-cloud-gateway
spring-cloud-gateway copied to clipboard
Why the header processing related to X-FORWARD is to modify the header value instead of multiple values.
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.