王小扬博客
Git
AI
产品
film
AI Code
Java
其他
计算机网络
DB
云原生
Node
Docker
操作系统
Elasticsearch
Apollo
Nestjs
Think
大前端
PHP
软件开发
设计
生活技巧
CI
缓存
HSTS Strict-Transport-Security(严格传输安全)
HSTS Strict-Transport-Security(严格传输安全)
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request
- - 原因是浏览器在发送http请求时自动进行307内部跳转,导致了跨域预检失败。 -- 为什么会307内部跳转呢? 是因为浏览器采用HSTS(HTTP Strcit-Transport-Securit)策略,将所有非http的请求内部跳转成https。 -- 为什么浏览器认为这个域名需要采用HSTS策略呢?因为服务端/nginx返回的http请求header里配置了Strict-Transport-Security(严格传输安全)选项。

Loading...