How Spring Cloud Gateway configures cross-domain
spring:
cloud:
gateway:
default-filters:
- DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_UNIQUE
globalcors:
cors-configurations:
'[/**]':
allowed-methods: "*"
allowed-headers: "*"
allow-credentials: true
allowed-origin-patterns: "*"
DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials, RETAIN_UNIQUE
The purpose of adding is to ensure that if the background returns cross-domain related headers, the gateway will not be added, otherwise it may cause the browser to report an error and the service cross-domain settings will not take effect.
0 Comments