我问这个是因为我安装了一个python插件,它只通过向OPTIONS方法(预检)添加CORS头来处理cors,但是没有添加到请求的资源,这种方法不解决Chrome和firefox上的cors问题,返回消息喜欢
Cross-Origin Request Blocked: The Same Origin Policy disallows reading
the remote resource at [URL]. This can be fixed by
moving the resource to the same domain or enabling CORS.
编辑:
我还在http://www.html5rocks.com/en/tutorials/cors/上找到了更多信息,其中说:
解决方法 他们必须出现在两个回复中.Access-Control-Allow-Origin (required) – This header must be included
in all valID CORS responses; omitting the header will cause the CORS
request to fail. The value of the header can either echo the Origin
request header (as in the example above),or be a ‘*’ to allow
requests from any origin. If you’d like any site to be able to access
your data,using ‘*’ is fine. But if you’d like finer control over who
can access your data,use an actual value in the header.
the preflight rules的第3步要求浏览器遵循正常的make a request steps.
@H_403_0@ 总结以上是内存溢出为你收集整理的html – CORS HEADERS仅在预检或每个请求中出现全部内容,希望文章能够帮你解决html – CORS HEADERS仅在预检或每个请求中出现所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)