Cloud Run hosted app - redirection results in CORS error | C2C Community
Solved

Cloud Run hosted app - redirection results in CORS error

  • 15 March 2022
  • 1 reply
  • 879 views

Userlevel 2
Badge

Hello-

I am running a frontend app on cloud run. When the backend server creates a redirect request to process a callback on the frontend app, cloud run response includes “access-control-allow-origin: *” from “

server: Google Frontend”

 

Chrome network trace shows the result was “CORS error” wildcard origin not allowed. The request for redirect header “ origin: null” was included by Chrome. 

How do we configure cloud run not to include access-contron-allpow-origin: * or send a custom origin matching the app custom domain hosted on cloud run?

 

Thanks,

 

icon

Best answer by guillaume blaquiere 15 March 2022, 18:36

View original

1 reply

Userlevel 6
Badge +15

Hi Mali.

Cloud Run doesn’t include the allow origin header by itself. You app must do it. Review your code, your libraries, your configuration, you should have an existing layer that perform that operation.

Reply