• notice
  • Congratulations on the launch of the Sought Tech site

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_UNIQUEThe 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.


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+