【问题标题】:Google cloud cors multiple accounts?谷歌云拥有多个帐户?
【发布时间】:2018-08-17 21:52:16
【问题描述】:

我想知道如何使用 cors 设置多个 Google 帐户。从下图(reference(2) url)可以清楚地看出,我们可以在 cors 上进行多个帐户设置。

有人可以帮助我吗?仅供参考,我遵循了这种方法https://cloud.google.com/storage/docs/gsutil/commands/cors

参考: 1.https://cloud.google.com/storage/docs/cross-origin

  1. https://cloud.google.com/storage/docs/xml-api/put-bucket-cors

【问题讨论】:

    标签: cors google-cloud-platform gsutil


    【解决方案1】:

    我认为你在这里混淆了一些东西。 Google accounts 与 CORS 无关。

    至于允许一个存储桶有多个来源,使用 gsutil 示例 you provided 作为基础,使用的 JSON 包含一个来源键/值对。该值是一个数组,可以包含多个逗号分隔的值:

    [
        {
            "origin": [
                "http://origin1.appspot.com",
                "http://origin2.appspot.com"
            ],
            "responseHeader": [
                "Content-Type"
            ],
            "method": [
                "GET"
            ],
            "maxAgeSeconds": 3600
        }
    ]
    

    另一种选择是提供多个对象,例如,如果您想对一个来源使用 GET 方法,而对另一个来源使用 GET & DELETE:

    [
        {
            "origin": [
                "http://origin1.appspot.com"
            ],
            "responseHeader": [
                "Content-Type"
            ],
            "method": [
                "GET"
            ],
            "maxAgeSeconds": 3600
        },
        {
            "origin": [
                "http://origin2.appspot.com"
            ],
            "responseHeader": [
                "Content-Type"
            ],
            "method": [
                "GET",
                "DELETE"
            ],
            "maxAgeSeconds": 3600
        }
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-23
      • 1970-01-01
      • 1970-01-01
      • 2020-06-28
      • 1970-01-01
      • 2019-05-15
      • 1970-01-01
      • 2018-07-25
      相关资源
      最近更新 更多