CORS xmlhttprequest HEAD 方法

发布于 2024-10-09 09:31:00 字数 173 浏览 0 评论 0原文

当使用 CORS 对象的 HEAD 方法请求标头数据时,它返回 null。

getAllResponseHeaders() ->;返回空值。

如何在其他站点中设置 php 标头,以便我可以检索标头数据>

ps:这不是在同一个域内。这是跨源资源共享

谢谢

When requesting header data using HEAD method with CORS object, it returns null.

getAllResponseHeaders() -> return null.

How to setup php headers in the other site so that I can retrieve header data>

p.s.: this is not within the same domain. it's a cross origin resource sharing

Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

别低头,皇冠会掉 2024-10-16 09:31:00

我在 Firefox (3.6.13) 中注意到了这种行为; getAllResponseHeaders() 什么也不返回。在 Chrome/Safari 中, getAllResponseHeaders() 仅返回简单的响应标头(如规范 http:// /www.w3.org/TR/cors/#terminology)。这些浏览器都不尊重 Access-Control-Expose-Headers 标头。

I've noticed this behavior in Firefox (3.6.13); getAllResponseHeaders() returns nothing. In Chrome/Safari, getAllResponseHeaders() only returns simple response headers (as defined in the spec http://www.w3.org/TR/cors/#terminology). None of these browsers respect the Access-Control-Expose-Headers header.

偏爱自由 2024-10-16 09:31:00

自从这个问题的最后一个答案以来,现代浏览器尊重 Access-Control-Expose-Headers 标头。

此错误已在最新版本的 IE (11)、Chrome (43) 和 Firefox (39) 中得到修复。

Since the last answer to this question, modern browsers respect the Access-Control-Expose-Headers header.

This bug is fixed in up to date versions of IE (11) and Chrome (43) and Firefox (39).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文