大佬教程收集整理的这篇文章主要介绍了Chrome和Firefox CORS AJAX呼叫在某些Mac机器上被中止,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在花费很长时间查看低级网络数据包后,尝试查找问题。原来,病毒扫描程序阻止了该呼叫。关闭网络扫描,它开始工作。
简而言之,Sophos在Firefox和Chrome上阻止了api.saddleBACk.com,但在Safari上没有阻止。去搞清楚。
我们在www.saddleBACk.com/live上有一个网页,Chrome和Firefox CORS AJAX调用在某些Mac机器上被中止。在装有OSX
10.9(最新更新),Chrome和Firefox(最新更新)的Mac上,对http://api.saddleBACk.com/Worshipservice?version=2&null&_=1386201207191的AJAX调用被终止。这适用于Safari。
此行为是孤立的,但在某些计算机上可重现,但在其他计算机上则无法重现。我们还有其他具有相同操作系统和浏览器版本的Mac机器,它们可以成功打开该网页。
我已验证Web服务器在500毫秒内成功响应了AJAX请求。但是Chrome会等待约30秒,等待响应,并最终终止通话。我为以下失败的电话添加了chrome://
net-internals:
11645: URL_requEST
http://api.saddleBACk.com/Worshipservice?version=2&null&_=1386201207191
Start Time: 2013-12-04 15:53:27.469
t=1386201207469 [st= 0] +requEST_ALIVE [dt=30398]
t=1386201207470 [st= 1] +URL_requEST_START_JOB [dt=30397]
--> load_flags = 143540480 (DO_NOT_SAVE_COOKIES | DO_NOT_SEND_AUTH_DATA | DO_NOT_SEND_COOKIES | ENABLE_LOAD_TIMING | MAYBE_user_GEstuRE | REPORT_RAW_HEADERS | VERIFY_EV_CERT)
--> method = "GET"
--> priority = 2
--> url = "http://api.saddleBACk.com/Worshipservice?version=2&null&_=1386201207191"
t=1386201207470 [st= 1] http_CACHE_GET_BACKEND [dt=0]
t=1386201207470 [st= 1] http_CACHE_OPEN_ENTRY [dt=0]
--> net_error = -2 (ERR_FAILED)
t=1386201207470 [st= 1] http_CACHE_CREATE_ENTRY [dt=0]
t=1386201207470 [st= 1] http_CACHE_ADD_TO_ENTRY [dt=0]
t=1386201207470 [st= 1] +http_STREAM_requEST [dt=2]
t=1386201207472 [st= 3] http_STREAM_requEST_BOUND_TO_JOB
--> source_dependency = 11647 (http_STREAM_JOB)
t=1386201207472 [st= 3] -http_STREAM_requEST
t=1386201207472 [st= 3] +http_transaCTION_SEND_requEST [dt=0]
t=1386201207472 [st= 3] http_transaCTION_SEND_requEST_HEADERS
--> GET /Worshipservice?version=2&null&_=1386201207191 http/1.1
Host: api.saddleBACk.com
Connection: keep-alive
Accept: application/json,text/javascript,*/*; q=0.01
Origin: http://www.saddleBACk.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/31.0.1650.63 Safari/537.36
Content-Type: application/json
Referer: http://www.saddleBACk.com/onlinecampus/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
t=1386201207472 [st= 3] -http_transaCTION_SEND_requEST
t=1386201207472 [st= 3] +http_transaCTION_READ_HEADERS [dt=30395]
t=1386201207472 [st= 3] +http_STREAM_PARSER_READ_HEADERS [dt=30395]
t=1386201237867 [st=30398] CANCELLED
t=1386201237867 [st=30398] -URL_requEST_START_JOB
--> net_error = -3 (ERR_ABORTED)
t=1386201237867 [st=30398] -requEST_ALIVE
这是Wireshark的请求和响应:
请求
GET /Worshipservice?version=2&null&_=1386192341441 http/1.1
[Expert Info (Chat/SequencE): GET /Worshipservice?version=2&null&_=1386192341441 http/1.1]
[message: GET /Worshipservice?version=2&null&_=1386192341441 http/1.1]
[Severity level: Chat]
[Group: Sequence]
request Method: GET
request URI: /Worshipservice?version=2&null&_=1386192341441
request Version: http/1.1
Host: api.saddleBACk.com
Connection: keep-alive
Cache-Control: max-age=0
Accept: application/json,*/*; q=0.01
Origin: http://www.saddleBACk.com
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/31.0.1650.57 Safari/537.36
Content-Type: application/json
Referer: http://www.saddleBACk.com/onlinecampus/
Accept-Encoding: gzip,sdch
Accept-Language: en-US,en;q=0.8
响应
http/1.1 200 OK
[Expert Info (Chat/SequencE): http/1.1 200 OK]
[message: http/1.1 200 OK]
[Severity level: Chat]
[Group: Sequence]
request Version: http/1.1
Status Code: 200
Response Phrase: OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
Access-Control-Allow-Origin: http://www.saddleBACk.com
Access-Control-Allow-Credentials: true
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Wed,04 Dec 2013 21:25:41 GMT
Content-Length: 2841
[Content length: 2841]
Set-Cookie: NSC_ndxfc1-45*80=ffffffffaf181c9545525d5f4f58455e445a4a423660;expires=Wed,04-Dec-2013 14:44:34 GMT;path=/;httponly
以上是大佬教程为你收集整理的Chrome和Firefox CORS AJAX呼叫在某些Mac机器上被中止全部内容,希望文章能够帮你解决Chrome和Firefox CORS AJAX呼叫在某些Mac机器上被中止所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。