You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "by" parameter identifies the proxy receiving the request, as specified in RFC 7239. This is useful for debugging and tracing in proxy/gateway environments.
Signed-off-by: raccoonback <[email protected]>
Copy file name to clipboardExpand all lines: spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/GatewayServerMvcAutoConfiguration.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ public FormFilter formFilter() {
Copy file name to clipboardExpand all lines: spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcProperties.java
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,11 @@ public class GatewayMvcProperties {
69
69
*/
70
70
private@NullableStringtrustedProxies;
71
71
72
+
/**
73
+
* Whether to add the "by" parameter to the Forwarded header.
74
+
*/
75
+
privatebooleanforwardedByEnabled = false;
76
+
72
77
/**
73
78
* In the case where Spring Retry is on the classpath but you still want to use Spring
74
79
* Framework retry as your retry filter, set this property to true.
@@ -123,13 +128,22 @@ public void setTrustedProxies(String trustedProxies) {
Copy file name to clipboardExpand all lines: spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/filter/ForwardedRequestHeadersFilter.java
+35-1Lines changed: 35 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,7 @@
19
19
importjava.net.Inet6Address;
20
20
importjava.net.InetAddress;
21
21
importjava.net.URI;
22
+
importjava.net.UnknownHostException;
22
23
importjava.util.ArrayList;
23
24
importjava.util.HashMap;
24
25
importjava.util.List;
@@ -47,6 +48,8 @@ public class ForwardedRequestHeadersFilter implements HttpHeadersFilter.RequestH
Copy file name to clipboardExpand all lines: spring-cloud-gateway-server-webmvc/src/test/java/org/springframework/cloud/gateway/server/mvc/filter/ForwardedRequestHeadersFilterTests.java
0 commit comments