I am trying to request data from Apache Druid server in my Angular SPA and getting the next issue related to the CORS configuration:
Access to XMLHttpRequest at URL from origin 'http://localhost:4200' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. SERVER_URL:8889/druid/v2/?pretty:1 Failed to load resource: net::ERR_FAILED
As far as I understood from the documentation I had to change the next set of properties in my configuration file:
druid.auth.allowUnauthenticatedHttpOptions=true druid.server.http.allowedHttpMethods =["POST", "GET", "OPTIONS"]
But even after that I still can’t retrieve any data from Druid API because of the issue.
I was also trying to fix that issue by adding the next extension to the Apache Druid configuration:
but it also didn’t change anything.
Does someone know what I am doing wrong or how can I fix that issue with CORS?