GCP App Engine Serving Static Files via Cloud Storage with CORS Issues
I'm prototyping a solution and I'm relatively new to this, so bear with me. I'm sure I'm missing something obvious here, but I'm trying to serve static files from a Cloud Storage bucket in my GCP App Engine application, but I'm running into CORS issues... When I attempt to access the files directly in my web app, I get the following behavior in the console: `Access to fetch at 'https://storage.googleapis.com/my-bucket/my-image.png' from origin 'https://myapp.appspot.com' has been blocked by CORS policy`. I've set the CORS configuration for my Cloud Storage bucket using the following command: ```bash gsutil cors set cors.json gs://my-bucket ``` Where `cors.json` contains: ```json [ { "origin": ["*"], "method": ["GET", "HEAD"], "maxAgeSeconds": 3600 } ] ``` I've waited for the configuration to propagate, but the scenario continues. I also tried accessing the files directly from the browser and received the same CORS behavior. In my app, I'm using the following code to load the image: ```javascript const imageUrl = 'https://storage.googleapis.com/my-bucket/my-image.png'; const img = new Image(); img.src = imageUrl; document.body.appendChild(img); ``` I've confirmed that the bucket is publicly accessible and that the file permissions are set correctly. I've also looked into the App Engine configuration, but I don't see any specific settings related to CORS. Is there something I'm missing in the Cloud Storage CORS setup or in the way I'm loading the images in my app? Any help would be appreciated! My development environment is Linux. Any ideas what could be causing this? My development environment is Ubuntu. Am I missing something obvious? I'm working on a application that needs to handle this.