File tree 1 file changed +4
-1
lines changed
docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
[[addresponseheader-gatewayfilter-factory]]
2
2
= `AddResponseHeader` `GatewayFilter` Factory
3
3
4
- The `AddResponseHeader` `GatewayFilter` Factory takes a `name` and `value` parameter .
4
+ The `AddResponseHeader` `GatewayFilter` Factory takes three parameters: `name`, `value` and `override`(default value is `true`) .
5
5
The following example configures an `AddResponseHeader` `GatewayFilter`:
6
6
7
7
.application.yml
@@ -15,9 +15,12 @@ spring:
15
15
uri: https://example.org
16
16
filters:
17
17
- AddResponseHeader=X-Response-Red, Blue
18
+ - AddResponseHeader=X-Response-Black, White, false
18
19
----
19
20
20
21
This adds `X-Response-Red:Blue` header to the downstream response's headers for all matching requests.
22
+ and if the response already contains the `X-Response-Black` header, this will not add the `X-Response-Black: White`
23
+ header to the downstream response's headers for all matching requests.
21
24
22
25
`AddResponseHeader` is aware of URI variables used to match a path or host.
23
26
URI variables may be used in the value and are expanded at runtime.
You can’t perform that action at this time.
0 commit comments