It took me some time to figure and I can say that there is no way to set CORS origins in google UI. So we will have to install gem inside our API project and deploy changes to google cloud:
- Add gem 'rack-cors' to gem file
- Bundle install
- Add following to application.rb:
config.middleware.insert_before 0, Rack::Cors do
resource '*', headers: :any, methods: :any
Don't forget to update '*' before deploying to production.