Solved

CORS Error Heroku hosted ReactApp

  • 27 October 2021
  • 5 replies
  • 628 views

  • Known Participant
  • 20 replies

Hi Team,

We are running GDCN 1.3  helm deployment kindly help us how to whitelist/whitlable the heroku hosted react app currently app throws CORS error
https://gdcn-test.herokuapp.com/

 

 



Please kindly help how add/enable this url in cors-origin via helm!

 

Thanks and Regards,
Ashok

icon

Best answer by Jiri Zajic 30 October 2021, 21:57

View original

5 replies

Userlevel 3

Hi Ashhok,

you will need to properly fill ingress.annotations as described in this article. Please check the chart example below:

 

ingress:
...
# Custom annotations that will be added to every Ingress object created by this chart, e.g.
# cert-manager.io/cluster-issuer: letsencrypt-production
# If you plan to do local development of GoodData.UI applications, you should also add
# CORS-related annotations like:
# nginx.ingress.kubernetes.io/enable-cors: "true"
# nginx.ingress.kubernetes.io/cors-allow-headers: "X-GDC-JS-SDK-COMP, X-GDC-JS-SDK-COMP-PROPS, X-GDC-JS-PACKAGE, X-GDC-JS-PACKAGE-VERSION, x-requested-with, X-GDC-VALIDATE-RELATIONS, DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Authorization"
# nginx.ingress.kubernetes.io/cors-allow-origin: http://localhost:3000
annotations: {}


 

Hi @Iva Gasparekova   Thanks for the response.


I am attaching my changes on customized values one of our stage environment kindly validated.

CORS error not coming after applying the above changes however react heroku app is redirected to login screen 

Please  help us how to fix and enable multiple domains/subdomains 

 

Thanks and Regards,
Ashok

Userlevel 3

Hello Ashok,

Can you please make sure you are including the `--backend=tiger` parameter when initiating a new create-gooddata-react-app?

npx --ignore-existing @gooddata/create-gooddata-react-app --backend=tiger

Please let me know!

Jiri

Hi @Iva Gasparekova 
We have upgraded to GDCN 1.4 CORS our React app again blocked by CORS
Plese kindly help us to make necessary  changes need if any

 

Thanks and Regards,
Ashok

Userlevel 3

Hello @ashok,

Updating to GoodData.CN version 1.4 shouldn’t have any effect on CORS. I learned from our Dev teams that we upgraded Kubernetes which caused one annotation to change (kubernetes.io/ingress.class: nginx), but this has nothing to do with CORS. If it worked before, please make sure that you are correctly replicating the same settings for CORS allowed origins in version 1.4, there shouldn’t be a difference!

Jiri

Reply