mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
fix index inconsistence in v1 api
This commit is contained in:
@@ -19,7 +19,8 @@ func GetKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
|
||||
}
|
||||
|
||||
// Convert event to a response and write to client.
|
||||
b, _ := json.Marshal(event.Response())
|
||||
b, _ := json.Marshal(event.Response(s.Store().Index()))
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(b)
|
||||
|
||||
|
||||
@@ -31,7 +31,8 @@ func WatchKeyHandler(w http.ResponseWriter, req *http.Request, s Server) error {
|
||||
}
|
||||
event := <-c
|
||||
|
||||
b, _ := json.Marshal(event.Response())
|
||||
// Convert event to a response and write to client.
|
||||
b, _ := json.Marshal(event.Response(s.Store().Index()))
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write(b)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user