alibaba / spring-cloud-alibaba

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
https://sca.aliyun.com
Apache License 2.0
27.73k stars 8.28k forks source link

spring cloud gateway got an error strict-origin-when-cross-origin #3797

Open 4d4d4d4 opened 1 month ago

4d4d4d4 commented 1 month ago

spring cloud starter gateway 4.1.4 It is expected that the request can be forwarded to the interface of other microservices through the gatew The request will encounter an error in the browser image The attempt on apifox was successful image This is the apifox request header information, according to reason should not encounter cross-domain issues I really don't understand want to ask for some advice image

4d4d4d4 commented 1 month ago
Related Configuration
server:
  port: 6000
spring:
  cloud:
    gateway:
      globalcors:
        add-to-simple-url-handler-mapping: true
        cors-configurations:
          '[/**]':
            allowed-origin-patterns:
              - "**"
            allowed-methods:
              - "GET"
              - "POST"
              - "DELETE"
              - "PUT"
              - "OPTIONS"
            allowed-headers:
              - "*"
            allow-credentials: true
            max-age: 36000
      routes:
        - id: member
          uri: http://127.0.0.1:6001
          predicates:
            - Path=/member/**
yuluo-yx commented 1 month ago

可能是 chrome 的默认策略问题

yuluo-yx commented 1 month ago

可能是 chrome 的默认策略问题

啥意思就是说,你在 apifox 没有指定协议,可能默认是 http,但是在 chrome 90 之后,如果不指定协议,默认走的是 https 协议。看看是不是这个问题

github-actions[bot] commented 11 hours ago

This issue has been open 30 days with no activity. This will be closed in 7 days.