Skip to content

Commit

Permalink
feat: add cors header for json endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
macrat committed May 1, 2021
1 parent ba05e18 commit 99cb68c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
func JSONExporter(s *store.Store) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=UTF-8")
w.Header().Set("Access-Controll-Allow-Origin", "*")
w.Header().Set("Access-Controll-Allow-Methods", "GET")

enc := json.NewEncoder(w)
enc.SetIndent("", " ")
Expand Down

0 comments on commit 99cb68c

Please sign in to comment.