Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. HTTP
  3. 指南
  4. 跨源资源共享(CORS)
  5. CORS 错误
  6. 原因:CORS request external redirect not allowed

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

原因:CORS request external redirect not allowed

原因

原因:CORS request external redirect not allowed

哪里错了?

服务器响应了CORS 请求,并将 HTTP 重定向到与原始请求不同源的 URL 上,这在 CORS 请求期间是不允许的。

例如,如果页面请求https://service.tld/fetchdata,并且服务器的 HTTP 响应是“301 Moved Permanently”、“307 Temporary Redirect”或“308 Permanent Redirect”,并且Locationhttps://anotherservice.net/getdata,那么 CORS 请求将以这种方式失败。

要解决此问题,请更新代码以使用重定向报告的新 URL,从而避免重定向。

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp