1
votes

I can't figure out how to allow request headers in Google Cloud Storage CORS requests.

According to the documentation, the Range HTTP header is supported, but I can't find a way to allow that for client-side XMLHttpRequests.

Here's my CORS configuration:

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

Example page

1

1 Answers

2
votes

It turns out the responseHeader key is used for both response and request headers.

My new config looks like this:

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