计算机阻塞CORS选项请求 [英] Computer Blocking CORS OPTIONS Request

查看:644
本文介绍了计算机阻塞CORS选项请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我疯狂!我试图使用Amazon S3 CORS请求,他们不工作在我的计算机上。似乎我的电脑阻塞或忽略OPTIONS请求。如果我从我的终端运行CURL命令:

This is driving me crazy! I'm trying to work with Amazon S3 CORS requests and they are not working on my computer. It seems that my computer is blocking or ignoring the OPTIONS request. If I run a CURL command from my terminal:

curl -i -X OPTIONS http://testing.bennadel.com.s3.amazonaws.com

...我得到:

curl:(52)从服务器回复空白

curl: (52) Empty reply from server

但是,如果我运行请求在相同路由器上的不同计算机(AirBook)上,我得到预期的响应(以XML格式):

However, if I run the same request on a different computer (AirBook) on the same router, I get the expected response (in XML format):

信息。需要原始请求标头。

Insufficient information. Origin request header needed.

我尝试刷新我的dsn缓存(通过dscacheutil)。我已尝试更改我的DNS以使用Google的公共DNS。我试过重新启动我的电脑。没有运气!此计算机会阻止OPTIONS请求,而我尝试允许的每台计算机都会阻止。

I've tried flushing my dsn cache (via dscacheutil). I've tried changing my DNS to use Google's public DNS. I've tried restarting my computer. No luck! This computer keeps blocking the OPTIONS request and every other computer that I try allows it.

建议?这台电脑(iMac)通过WiFi连接到我的路由器;

Suggestions? This computer (iMac) is connecting to my router over WiFi; but, so does the AirBook, which makes successful OPTIONS requests.

另外请注意,对相同URL的非OPTIONS请求工作正常(即GET)。

Also note, non-OPTIONS requests to the same URL work fine (ie, GET).

推荐答案

更具体地说,问题似乎在于AnyConnect的Web安全模块。我能够解决这个问题,卸载并重新安装AnyConnect与Web安全选项取消选中;或者,只需运行websecurity_uninstall.sh脚本。 (这是使用AnyConnect 3.1.04074。)

More specifically, the problem seems to be in the Web Security module of AnyConnect. I was able to fix the problem by uninstalling and reinstalling AnyConnect with the Web Security option unchecked; or, just by running the websecurity_uninstall.sh script. (This was with AnyConnect 3.1.04074.)

感谢@ user3021922和其他人识别问题 - 这也让我疯狂。

Thanks to the @user3021922 and others for identifying the issue - this was driving me crazy too.

这篇关于计算机阻塞CORS选项请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆