Google api 尝试在Google云存储上列出bucket内容时无法使CORS工作(404未找到)
我遵循了CORS的所有说明和“故障排除”指南,但我感觉它不起作用。。在过去的两天里,我一直在尝试列出一个bucket的内容,无论我如何为bucket配置CORS,它都会以同样的方式失败 我正在使用的内容: angularJS客户端应用程序使用本地机器(即localhost)的JSON API直接与Google云存储对话 遵循此处的所有建议:Google api 尝试在Google云存储上列出bucket内容时无法使CORS工作(404未找到),google-api,Google Api,我遵循了CORS的所有说明和“故障排除”指南,但我感觉它不起作用。。在过去的两天里,我一直在尝试列出一个bucket的内容,无论我如何为bucket配置CORS,它都会以同样的方式失败 我正在使用的内容: angularJS客户端应用程序使用本地机器(即localhost)的JSON API直接与Google云存储对话 遵循此处的所有建议: Remote Address:74.125.193.132:443 Request URL:https://storage.googleapis.com/
Remote Address:74.125.193.132:443
Request URL:https://storage.googleapis.com/storage/v1beta2/b/okrp-dev/o
Request Method:OPTIONS
Status Code:200 OK
Request Headers
:host:
storage.googleapis.com
:method:OPTIONS
:path: /storage/v1beta2/b/okrp-dev/o
:scheme:https
:version:
HTTP/1.1
accept:*/*
accept-encoding:
gzip,deflate,sdch
accept-language:en-US,en;q=0.8,tr;q=0.6
access-control-request-headers:access-control-allow-origin, accept, authentication
access-control-request-method:GET
cache-control:
no-cache
origin:
http://localhost
pragma:
no-cache
referer:http://localhost/okrp/app/
Response Headersview source
alternate-protocol:443:quic
cache-control:
private, max-age=0
content-length:0
content-type:
text/html; charset=UTF-8
server:HTTP Upload Server Built on Mar 5 2014 15:51:04 (1394063464)
status:200 OK
version:
HTTP/1.1
我的桶:
gs://okrp-dev
<?xml version="1.0" ?>
<CorsConfig>
<Cors>
<Origins>
<Origin>*</Origin>
<Origin>
http://localhost</Origin>
</Origins>
<Methods>
<Method>GET</Method>
<Method>POST</Method>
<Method>HEAD</Method>
</Methods>
<ResponseHeaders>
<ResponseHeader>*</ResponseHeader>
</ResponseHeaders>
<MaxAgeSec>86400</MaxAgeSec>
</Cors>
</CorsConfig>
错误(chrome最新浏览器)
XMLHttpRequest无法加载。请求的资源上不存在“Access Control Allow Origin”标头。来源“http://localhost因此不允许访问
现在我的CORS文件(尽管我尝试了所有其他排列):
bash-3.2$gsutil cors get gs://okrp-dev
<?xml version="1.0" ?>
<CorsConfig>
<Cors>
<Origins>
<Origin>*</Origin>
<Origin>
http://localhost</Origin>
</Origins>
<Methods>
<Method>GET</Method>
<Method>POST</Method>
<Method>HEAD</Method>
</Methods>
<ResponseHeaders>
<ResponseHeader>*</ResponseHeader>
</ResponseHeaders>
<MaxAgeSec>86400</MaxAgeSec>
</Cors>
</CorsConfig>
注意我的身份验证工作正常。我再也拿不到401了。只有404。
注意我当然也完全打开了bucket和object的所有权限,这一点都没有帮助
我还可以如何对此进行故障排除