当前位置:网站首页>Dual cross domain: access allow origin header contains multiple values "*, *", but only one is allowed

Dual cross domain: access allow origin header contains multiple values "*, *", but only one is allowed

2022-06-23 00:44:00 With respect

problem : The front-end debugging found two in the interface response header Access-Allow-Origin , But the back end goes through apifox perhaps postman Debugging can not re - solve the problem .
reason : The background is at the gateway (spring cloud gateway) After cross domain is enabled , The service also intercepts specific paths for cross domain .wtf.

spring:
   cloud:    
    gateway:
    	# Solve dual cross domain problems 
      default-filters:
        - DedupeResponseHeader=Access-Control-Allow-Origin Access-Control-Allow-Credentials,
      globalcors:
          cors-configurations:
             '[/**]':
             allowed-origins: "*"
             allowed-methods: "*"
             allowed-headers: "x-requested-with,Content-Language,Authorization,Access-Control-Allow-Origin,request-id,Accept-Language,content-type,content-disposition"
             allow-credentials: true
原网站

版权声明
本文为[With respect]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/173/202206222117327154.html