Skip to content

Commit

Permalink
Query Frontend: Set CORS header (thanos-io#3414)
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>
Signed-off-by: Oghenebrume50 <raphlbrume@gmail.com>
  • Loading branch information
hwoarang authored and Oghenebrume50 committed Dec 7, 2020
1 parent e7b34e9 commit 4d6a5ff
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 @@ -29,6 +29,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

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 4d6a5ff

Please sign in to comment.