Merge pull request #2427 from thequux/send-headers-immediately

Make /events API send headers immediately
This commit is contained in:
Michael Crosby
2013-11-04 08:49:27 -08:00
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -236,6 +236,7 @@ func getEvents(srv *Server, version float64, w http.ResponseWriter, r *http.Requ
}
w.Header().Set("Content-Type", "application/json")
wf := utils.NewWriteFlusher(w)
wf.Flush()
if since != 0 {
// If since, send previous events that happened after the timestamp
for _, event := range srv.events {