http - 为什么 CORS 规范不允许重定向?

标签 http redirect cors w3c

W3C CORS spec第 2 步中明确指出:

If the response has an HTTP status code of 301, 302, 303, 307, or 308

 Apply the cache and network error steps.

我认为添加此措施是为了降低安全风险。但是,我无法找到详细说明允许重定向的安全后果的来源。


关于如何规避这个问题的问题已经被问到before .我正在寻找为什么首先将此条款包含在规范中的解释,例如以下问题:

CORS - What is the motivation behind introducing preflight requests?

Why does a cross-origin HEAD request need a preflight check?

最佳答案

来自WHATWG mailing list :

Mostly because with preflight fetches everything gets more complicated. We did leave the door open to potentially allow this at some point, provided we figure out a sane protocol, but left it out initially for simplicity.

关于http - 为什么 CORS 规范不允许重定向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24135854/

相关文章:

PHP 不能在带有 http_build_query() 的数组中使用 'not'

php - 使用 CodeIgniter 的移动版网站

apache - 如何在 htaccess 中将除一个页面之外的所有页面定向到 HTTPS?

ajax - --disable-web-security 在 Chrome 中还能用吗?

google-chrome - 使用 Google Cloud Storage 的 Google Chrome 中的范围请求出现 CORS 错误

http - 是否有用于关闭浏览器响应缓存的 spring 3.1 MVC 注释?

node.js - IIS 覆盖 Express 响应的正文

javascript - 应用程序加载时间中分离的 javascript 文件的开销

java - 安卓代理应用程序

jquery - Angular $http.delete CORS 错误(预检请求)