From 3e4ac5326888ce1f02024d2018c6c099477422cf Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Thu, 5 Nov 2020 16:14:26 +0000 Subject: [PATCH] Query Frontend: Set CORS header Set CORS to the query frontend component in order to be able to freely access it from Grafana's living elsewhere. This is similar to what already happens for the Query component. Signed-off-by: Markos Chandras --- CHANGELOG.md | 1 + cmd/thanos/query_frontend.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index edd58d23dbe..33ed1bb8a90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#3257](https://github.com/thanos-io/thanos/pull/3257) Ruler: Prevent Ruler from crashing when using default DNS to lookup hosts that results in "No such hosts" errors. - [#3331](https://github.com/thanos-io/thanos/pull/3331) Disable Azure blob exception logging - [#3341](https://github.com/thanos-io/thanos/pull/3341) Disable Azure blob syslog exception logging +- [#3414](https://github.com/thanos-io/thanos/pull/3414) Set CORS for Query Frontend ### Changed diff --git a/cmd/thanos/query_frontend.go b/cmd/thanos/query_frontend.go index 674ddd0c966..2525c5d56d4 100644 --- a/cmd/thanos/query_frontend.go +++ b/cmd/thanos/query_frontend.go @@ -199,6 +199,8 @@ func runQueryFrontend( instr := func(f http.HandlerFunc) http.HandlerFunc { hf := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { name := "query-frontend" + // Set CORS to frontend client + w.Header().Set("Access-Control-Allow-Origin", "*") ins.NewHandler( name, logMiddleware.HTTPMiddleware(