Fix line delimited JSON response

For GET /events, line delimit JSON.
Fixes #7047

Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com>

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com> (github: )
Upstream-commit: d2f75a3040e72562ffa825d5c3efa7004af2640a
Component: engine
This commit is contained in:
Jessica Frazelle
2014-09-04 12:02:52 -07:00
committed by Jessica Frazelle
parent 4ee36fda1c
commit 0db8f36c75
3 changed files with 64 additions and 0 deletions

View File

@ -278,6 +278,8 @@ func getEvents(eng *engine.Engine, version version.Version, w http.ResponseWrite
}
var job = eng.Job("events")
// lineDelimited JSON events was added #7047
job.SetenvBool("lineDelim", version.GreaterThanOrEqualTo("1.15"))
streamJSON(job, w, true)
job.Setenv("since", r.Form.Get("since"))
job.Setenv("until", r.Form.Get("until"))