mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: don't allow methods other than GET in /debug/vars
Currently, /debug/vars seems to allow all types of methods e.g. PUT, POST, etc. However, this path is a readonly stuff so it should allow GET only.
This commit is contained in:
parent
7dcb99b60e
commit
1b0c65c299
@ -324,6 +324,10 @@ func (h *statsHandler) serveLeader(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func serveVars(w http.ResponseWriter, r *http.Request) {
|
func serveVars(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if !allowMethod(w, r.Method, "GET") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
fmt.Fprintf(w, "{\n")
|
fmt.Fprintf(w, "{\n")
|
||||||
first := true
|
first := true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user