fix index inconsistence in v1 api

This commit is contained in:
Xiang Li
2013-12-11 11:12:39 -08:00
parent f66bd1689d
commit a5bca025b1
4 changed files with 14 additions and 4 deletions

View File

@@ -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)

View File

@@ -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)