*: move v2http handlers without /v2 prefix to etcdhttp
Lets --enable-v2=false configurations provide /metrics, /health, etc. Fixes #8167
This commit is contained in:

committed by
Gyu-Ho Lee

parent
ff9a0a3527
commit
8ab42fb045
@ -154,9 +154,10 @@ func (e Error) StatusCode() int {
|
||||
return status
|
||||
}
|
||||
|
||||
func (e Error) WriteTo(w http.ResponseWriter) {
|
||||
func (e Error) WriteTo(w http.ResponseWriter) error {
|
||||
w.Header().Add("X-Etcd-Index", fmt.Sprint(e.Index))
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(e.StatusCode())
|
||||
fmt.Fprintln(w, e.toJsonString())
|
||||
_, err := w.Write([]byte(e.toJsonString() + "\n"))
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user