XHR 重定向问题
假设我有三个域 A、B 和 C。B 和 CI 都确保在发出请求时发送 Access-Control-Allow-Origin: *
。
现在在域 AI 上运行这样的 XHR:
xhr.open("GET", "B/abc.wav")
xhr.send()
B 将重定向到 C。
Content-Type: text/plain
Connection: keep-alive
Keep-Alive: timeout=60
Location: http://C/something/abc.wav
Content-Length: 0
Access-Control-Allow-Origin: *
C 将回复
Content-Type: audio/wav
Connection: keep-alive
Keep-Alive: timeout=65
Accept-Ranges: bytes
Content-Length: 1003914
Access-Control-Allow-Origin: *
我遇到的问题是,在 Chrome 14.0.835.126 beta-m 中,我收到一个错误,但没有给我任何提示。这失败了。
我只看到“[Exception: DOMException]”作为 XHR 的响应。 网络上的大多数示例都建议添加我已经完成的 ACAO 标头,但实际上没有一个示例讨论多重重定向的场景。这有可能吗?
Imagine I have three domains A, B, and C. On both B and C I have made sure that Access-Control-Allow-Origin: *
is sent when making a request.
Now on domain A I run an XHR like this:
xhr.open("GET", "B/abc.wav")
xhr.send()
B will make a redirect to C.
Content-Type: text/plain
Connection: keep-alive
Keep-Alive: timeout=60
Location: http://C/something/abc.wav
Content-Length: 0
Access-Control-Allow-Origin: *
C will reply with
Content-Type: audio/wav
Connection: keep-alive
Keep-Alive: timeout=65
Accept-Ranges: bytes
Content-Length: 1003914
Access-Control-Allow-Origin: *
The issue I have is that in Chrome 14.0.835.126 beta-m I get an error as a result without giving me any hint of why this fails.
I only see "[Exception: DOMException]" as the response of the XHR.
Most examples on the web suggest to add the ACAO header which I have done but none actually talks about the scenario of multiple redirects. Is this possible at all?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论