From 0264821189526386fa375518d56b674bb0c0cb51 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Tue, 19 Jul 2016 18:10:43 +0200 Subject: [PATCH] Comment option to set CORS for GCS bucket This is originally introduced to enable access from pillar-web javascript to GCS buckets (via the vrview.js library). For the moment it is commented since we do not allow HDRI node_type in all projects. --- pillar/application/utils/gcs.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pillar/application/utils/gcs.py b/pillar/application/utils/gcs.py index e9e2aeef..23b336c7 100644 --- a/pillar/application/utils/gcs.py +++ b/pillar/application/utils/gcs.py @@ -35,11 +35,19 @@ class GoogleCloudStorageBucket(object): self.bucket = gcs.bucket(bucket_name) # Hardcode the bucket location to EU self.bucket.location = 'EU' + # Optionally enable CORS from * (currently only used for vrview) + # self.bucket.cors = [ + # { + # "origin": ["*"], + # "responseHeader": ["Content-Type"], + # "method": ["GET", "HEAD", "DELETE"], + # "maxAgeSeconds": 3600 + # } + # ] self.bucket.create() self.subdir = subdir - def List(self, path=None): """Display the content of a subdir in the project bucket. If the path points to a file the listing is simply empty.