spring:
cloud:
gateway:
routes:
- id: user
uri: http://127.0.0.1:8082
predicates:
- Path=/user/**
filters:
- AddRequestHeader=X-Request-Red, Blue
此请求将X-Request-red:blue
标头添加到所有匹配请求的下游请求标头中
spring:
cloud:
gateway:
routes:
- id: user
uri: http://127.0.0.1:8082
predicates:
- Path=/user/**
filters:
- AddRequestParameter=red, blue
将添加red=blue
到所有匹配请求的下游请求的查询字符串中
spring:
cloud:
gateway:
routes:
- id: user
uri: http://127.0.0.1:8082
predicates:
- Path=/user/**
filters:
- AddResponseHeader=X-Response-Red, Blue
将X-Response-Foo:Bar
标头添加到所有匹配请求的下游响应标头中。
spring:
cloud:
gateway:
routes:
- id: user
uri: http://127.0.0.1:8082
predicates:
- Path=/user/**
filters:
- DedupeResponseHeader=Access-Control-Allow-Credentials Access-Control-Allow-Origin