在storage.googleapis.com上设置Access-Control-Allow-Credentials = true?

时间:2018-02-05 11:41:34

标签: cors google-cloud-storage

我尝试在storage.googleapis.com存储桶上设置CORS标头var cache = {id1 : {a:1, b:2}, id2 : {a:5, b:2}, id3 : {a:1, b:4}}; var changed = ["id1", "id3"]; var result = changed.map(id => cache[id]); console.log(result);。原因是我无法控制Access-Control-Allow-Credentials=true中的XHR参数。

我能够正确设置whithCredentials=true标题,但我无法在Google云端存储文档中找到有关特定标题Access-Control-Allow-Origin的任何提及。

Access-Control-Allow-Credentials

你知道这是否可行以及如何做到这一点?

1 个答案:

答案 0 :(得分:1)

正如您已经提到的,您可以将存储桶配置为支持CORS,但是,目前,在Google云端存储(GCS)中,您只能set some metadata fields,例如Cache-Control,内容 - 分配,内容编码,内容 - 语言,内容 - 语言和自定义元数据。

您可能希望在open中为Google Issue Tracker提供access controls options功能请求。

作为一种可能的解决方法,您可能希望使用GCS可用的任何The documentation

相关问题