CORS error while connecting to redash api

Issue Summary

I have a redash instance hosted on AWS. I am creating a new seperate client app which can display data by fetching queries using api/queries

however when I try to connect with the api using web Fetch call, I face CORS error with the message “Access to fetch at ‘https://my-server.com/api/queries?api_key=xxxx’ from origin ‘https://dev-enviroment:3000’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource”.

To solve this, i came across an env variable “REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN” whose value I tried setting to :

  1. “*”
  2. “dev-environment”

But no success yet.

  • I also tried setting a manual proxy using http-proxy-middleware package which solves the error in dev enviorment. but on production this doesnot work

Can you guide me on how I can solve this CORS error

Technical details:

  • Redash Version: v8
  • Browser/OS: chrome & firefox
  • How did you install Redash: docker

How did you test your changes to REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN`? Did you restart the instance?

hey @k4s1m , yes for every changes i made to REDASH_CORS_ACCESS_CONTROL_ALLOW_ORIGIN I had restarted the instance.

The issue here is the CORS support is only partially implemented in Redash v8. I’ve posted another topic requesting more details from the Redash development team.

@arikfr - could you please look into this ?