【发布时间】:2011-01-04 11:55:44
【问题描述】:
Firefox send a cross-domain post with credentials,我可以(使用 Charles - HTTP 调试代理)看到服务器正在发回响应……但 Firefox 并没有“让我看到它”(因为没有更好的描述)。
例如,使用the documented example:
>>> var 调用 = 新 XMLHttpRequest(); >>> invocation.open('GET', 'http://localhost/~wolever/cookie.php', true); >>> 调用.withCredentials=true; >>> 调用.onreadystatechange = 控制台.log; >>> 调用.send() http://img.skitch.com/20100113-bq3a4qb1ufn52331x18ce3c7xu.png >>> 调用.responseText “” >>> 调用.responseXML 空值但是,Charles 告诉我,这个请求实际上已经返回了预期的响应:
http://img.skitch.com/20100113-njakyu4xequ5e3cyfhfnyeatq5.png
知道可能出了什么问题吗?
而且,如果它有帮助:没有凭据的相同请求会返回应有的数据。
【问题讨论】:
-
只是一个疯狂的猜测,你可以尝试用
127.0.0.1替换localhost,以防在使用本地主机时发生一些“特殊情况”魔法?
标签: firefox xmlhttprequest cross-domain