【问题标题】:google-cloud-storage CORS for request headers用于请求标头的 google-cloud-storage CORS
【发布时间】:2017-12-18 14:47:50
【问题描述】:

我不知道如何在 Google Cloud Storage CORS 请求中允许请求标头。

根据文档the Range HTTP header is supported,但我找不到允许客户端 XMLHttpRequests 这样做的方法。

这是我的 CORS 配置:

$ gsutil cors get gs://df-ai-movies
[{"maxAgeSeconds": 3600, "method": ["GET", "HEAD", "OPTIONS"], "origin": ["*"], "responseHeader": ["Date"]}]

Example page

【问题讨论】:

    标签: cors google-cloud-storage


    【解决方案1】:

    原来responseHeader 键同时用于响应请求标头。

    我的新配置如下所示:

    [{"maxAgeSeconds": 3600, "method": ["GET", "HEAD", "OPTIONS"], "origin": ["*"], "responseHeader": ["Date", "Range"]}]
    

    【讨论】:

      猜你喜欢
      • 2022-12-01
      • 2021-03-22
      • 2019-01-18
      • 2014-10-30
      • 2020-11-17
      • 1970-01-01
      • 2020-06-03
      • 2016-09-13
      • 2016-01-19
      相关资源
      最近更新 更多