mirror of https://github.com/prometheus/prometheus
Merge pull request #841 from prometheus/fix-cors-perms
Disallow cross-origin DELETE and POST requests.pull/843/head
commit
32a77085e0
|
@ -65,7 +65,7 @@ type API struct {
|
||||||
// Enables cross-site script calls.
|
// Enables cross-site script calls.
|
||||||
func setCORS(w http.ResponseWriter) {
|
func setCORS(w http.ResponseWriter) {
|
||||||
w.Header().Set("Access-Control-Allow-Headers", "Accept, Authorization, Content-Type, Origin")
|
w.Header().Set("Access-Control-Allow-Headers", "Accept, Authorization, Content-Type, Origin")
|
||||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE")
|
w.Header().Set("Access-Control-Allow-Methods", "GET")
|
||||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
w.Header().Set("Access-Control-Expose-Headers", "Date")
|
w.Header().Set("Access-Control-Expose-Headers", "Date")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue