11

How can I send custom HTTP headers with a bucket backend for Cloud CDN without the x-goog-meta- prefix?

In particular, I'm trying to send a Content-Security-Policy header, which turns into x-goog-meta-Content-Security-Policy and thus is ignored by the browser.

Screenshot: Google Storage/ Bucket Meta data UI

Screenshot: Google Storage/ Bucket Meta data UI

Screenshot: Response headers

Screenshot: Response headers

mattes
  • 8,936
  • 5
  • 48
  • 73
  • Yes those headers are added when working with custom metadata. It is explained in these articles [1](https://cloud.google.com/storage/docs/gsutil/addlhelp/WorkingWithObjectMetadata#custom-metadata) and [2](https://cloud.google.com/storage/docs/xml-api/reference-headers#xgoogmeta). I am doing some research to see if I can find a useful workaround. – Carlos May 09 '17 at 15:25
  • 6
    Unfortunately at the moment setting up that header is not possible. There is an existing [feature request](https://issuetracker.google.com/issues/36427250) – Carlos May 12 '17 at 20:35
  • 1
    Does this answer your question? [Add CSP header to Google Cloud Storage](https://stackoverflow.com/questions/59500153/add-csp-header-to-google-cloud-storage) – sergeykish Oct 05 '20 at 10:30

0 Answers0