From 989dd6233a61e34bf7fe3d65f06a4804dcae9e7d Mon Sep 17 00:00:00 2001 From: jiangyuan Date: Tue, 20 May 2025 12:28:50 +0800 Subject: [PATCH] update docs Signed-off-by: jiangyuan --- .../gatewayfilter-factories/addresponseheader-factory.adoc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories/addresponseheader-factory.adoc b/docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories/addresponseheader-factory.adoc index e15ea73c..f13de378 100644 --- a/docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories/addresponseheader-factory.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-gateway/gatewayfilter-factories/addresponseheader-factory.adoc @@ -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.