CORS xmlhttprequest HEAD method

孤人 提交于 2019-12-02 04:33:33

问题


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


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/4561221/cors-xmlhttprequest-head-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!