防止重定向XMLHttpRequest

Zim提出了一个问题:Prevent redirection of Xmlhttprequest,或许与您遇到的问题类似。

回答者GiliRelaXNow给出了该问题的处理方式:

Not according to the W3C standard for the XMLHttpRequest object(emphasis added):

If the response is an HTTP redirect:

If the origin of the URL conveyed by the Location header is same origin with the XMLHttpRequest origin and the redirect does not violate infinite loop precautions, transparently follow the redirectwhile observing the same-origin request event rules.

They were consideringit for a future release:

This specification does not include the following features which are being considered for a future version of this specification:

  • Property to disable following redirects;

but the latestspecification no longer mentions this.

希望本文对你有帮助,欢迎支持JavaScript中文网

原文链接:stackoverflow.com

上一篇:为什么导出默认常量无效?
下一篇:什么是“扩大”咕噜”副本做的选择吗?所有的例子都使用它,但是文档并没有说明它做了什么。

相关推荐

官方社区

扫码加入 JavaScript 社区