update docs

Signed-off-by: jiangyuan <joe469391363@gmail.com>
This commit is contained in:
jiangyuan
2025-05-20 12:28:50 +08:00
parent ca861ff4c8
commit 989dd6233a

View File

@@ -1,7 +1,7 @@
[[addresponseheader-gatewayfilter-factory]]
= `AddResponseHeader` `GatewayFilter` Factory
The `AddResponseHeader` `GatewayFilter` Factory takes a `name` and `value` parameter.
The `AddResponseHeader` `GatewayFilter` Factory takes three parameters: `name`, `value` and `override`(default value is `true`) .
The following example configures an `AddResponseHeader` `GatewayFilter`:
.application.yml
@@ -15,9 +15,12 @@ spring:
uri: https://example.org
filters:
- AddResponseHeader=X-Response-Red, Blue
- AddResponseHeader=X-Response-Black, White, false
----
This adds `X-Response-Red:Blue` header to the downstream response's headers for all matching requests.
and if the response already contains the `X-Response-Black` header, this will not add the `X-Response-Black: White`
header to the downstream response's headers for all matching requests.
`AddResponseHeader` is aware of URI variables used to match a path or host.
URI variables may be used in the value and are expanded at runtime.