File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11[[addresponseheader-gatewayfilter-factory]]
22= `AddResponseHeader` `GatewayFilter` Factory
33
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`) .
55The following example configures an `AddResponseHeader` `GatewayFilter`:
66
77.application.yml
@@ -15,9 +15,12 @@ spring:
1515 uri: https://example.org
1616 filters:
1717 - AddResponseHeader=X-Response-Red, Blue
18+ - AddResponseHeader=X-Response-Black, White, false
1819----
1920
2021This 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.
2124
2225`AddResponseHeader` is aware of URI variables used to match a path or host.
2326URI variables may be used in the value and are expanded at runtime.
You can’t perform that action at this time.
0 commit comments