您好,我已经尝试了几天来解决我的跨域问题,但没有成功
我正在使用最新版本的谷歌云存储 API 并通过 gustils 设置我的 cors
gsutils cors sets cors.json gs://mybucket
这是我的 cors.json
[
{
"origin": ["*"],
"method": ["GET", "HEAD", "DELETE", "PUT", "OPTIONS"],
"maxAgeSeconds": 1800,
"ResponseHeader": ["*"]
}
]
但是由于某种原因,当我尝试通过我的网络表单上传我的文件并且之后我使用 xhr 时,我仍然遇到问题
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://storage.googleapis.com//buckettest/Kung-Fu-panda-21.jpg?GoogleAccessId=xxxxxxxxxh@developer.gserviceaccount.com&https://storage.googleapis.com//ilovemeteor/Kung-Fu-panda-21.jpg&Expires=86400&Signature=xxxxxxxxxxxxxxxxxxxx. This can be fixed by moving the resource to the same domain or enabling CORS.
我正在使用带有 PUT 的签名 url 方法