Skip to content

Commit

Permalink
Query Frontend: Set CORS header
Browse files Browse the repository at this point in the history
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 <markos@chandras.me>
  • Loading branch information
hwoarang committed Nov 5, 2020
1 parent a4576d8 commit 6029089
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- [$XXXX](https://github.com/thanos-io/thanos/pull/XXXX) Set CORS for Query Frontend

### Changed

Expand Down
2 changes: 2 additions & 0 deletions cmd/thanos/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/weaveworks/common/user"

"github.com/thanos-io/thanos/pkg/api"
"github.com/thanos-io/thanos/pkg/component"
"github.com/thanos-io/thanos/pkg/extflag"
"github.com/thanos-io/thanos/pkg/extkingpin"
Expand Down Expand Up @@ -199,6 +200,7 @@ func runQueryFrontend(
instr := func(f http.HandlerFunc) http.HandlerFunc {
hf := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
name := "query-frontend"
api.SetCORS(w)
ins.NewHandler(
name,
logMiddleware.HTTPMiddleware(
Expand Down

0 comments on commit 6029089

Please sign in to comment.