こんにちは、クロスオリジンの問題を解決するために数日間試みましたが、成功しませんでした
Google クラウド ストレージ API の最新バージョンを使用しており、gustils を介してコアをセットアップしています。
gsutils cors sets cors.json gs://mybucket
ここに私のcors.jsonがあります
[
{
"origin": ["*"],
"method": ["GET", "HEAD", "DELETE", "PUT", "OPTIONS"],
"maxAgeSeconds": 1800,
"ResponseHeader": ["*"]
}
]
しかし、何らかの理由で、Web フォーム経由でファイルをアップロードしようとして、その後 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 メソッドを使用しています