Safari浏览器是否忽略5.1访问控制 - 允许 - 产地*通配符?通配符、产地、访问控制、浏览器

2023-09-10 17:39:38 作者:老娘不拽怎能夺你心

试图让一个跨协议,从https同一个域请求HTTP。我已经设置了响应头读访问控制 - 允许 - 产地:* 这确实是工作在Chrome中。然而,它不在Safari工作

Trying to make a cross protocol, same domain request from https to http. I have set the response headers to read Access-Control-Allow-Origin: * which is indeed working in Chrome. However, it doesn't work in Safari.

时的Safari浏览器忽略通配符?难道是给错误的错误,确实有一个不同的问题?

Is Safari ignoring the wildcard? Is it giving the wrong error and indeed there is a different problem?

推荐答案

发现,这确实不是这样的。相反,正在发生的事情是,Safari浏览器正在一个OPTIONS调用AJAX调用之前的服务器,在我的情况我的服务器架构不无额外编码支持。

Found out that this indeed not the case. Instead what is happening is that Safari is making an OPTIONS call to the server before the AJAX call, and in my case my server framework doesn't support it without extra coding.

您可以在这里看到它的文档:

You can see it here in the docs:

http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/SafariJSProgTopics/Articles/XHR.html

 
精彩推荐
图片推荐