In order to download files from DigitalOcean Spaces CDN using xhr, I need to add a following CORS header to OPTIONS/GET responses: Access-Control-Expose-Headers: ETag, Content-Range. If I don’t do that, I get a similar error in my google chrome console: Refused to get unsafe header "etag" (see

Spaces CDN settings make it possible to allow additional request headers (Access-Control-Allow-Headers), but there’s no option to expose additional headers (Access-Control-Expose-Headers).

Since I’m using CloudFlare for DNS management, I worked around this issue by deploying a web worker that adds Access-Control-Expose-Headers: ETag, Content-Range to every response from spaces CDN but ideally this would be possible in spaces settings.

Has anybody run into this issue? Do you know if they have plans to add this setting?

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!