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 3e4ac53
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
- [#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 @@ -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(
Expand Down

0 comments on commit 3e4ac53

Please sign in to comment.