Google Cloud Workstation - CORS headers on workstation generated 302 redirect

When using cloud workstation for my multi-service development, I ran into a CORs issue on the followingCloud Workstation location, which generates a 302 redirect response 

```https://ssh.cloud.google.com/devshell/gateway```.

Upon investigation, the required http headers are not being duplicated, the primary one in question is:
```Access-Control-Allow-Origin```
My question:

Is there a command for cloud workstations, which can define required headers for my services, similar to the response for Google Cloud Run found here:

https://www.googlecloudcommunity.com/gc/Serverless/Cloud-run-cors-policy/m-p/512265/highlight/true#M...

1 5 679
5 REPLIES 5

Hi @amaxwell01 ,

Welcome to the Google Cloud Community!

Try to perform the following troubleshoot options:

  1. Check this Stack Overflow Post about redirects. When a request gets redirected across origins, the browser changes the Origin to null. Because of this, the Origin won't match configured values. What you can do here is to set Access-Control-Allow-Origin: * 
  2. You can also get in touch with Google Cloud Support to look into your case.

let me know if it helped, thanks!

Hello Marramirez,

These steps don't resolve the issue of my public HTTP making to my cloud workstation . Google has a form of authentication setup which is blocking the requests from making it to my cloud workstation. I've tried the steps described:

https://cloud.google.com/workstations/docs/authentication but these still fail to make it to the cloud workstation.

I am having a similar issue to this. Did you ever resolve your problem?

What they don't include in the documentation is that the URL provided is for only 1 service. In order to run multiple services you need to use the TCP/SSH tunnel support and run your services on your localhost.

Same here! Faced this situation before on my own Coder OSS server, now GCP Workstation.