Revert "Change content-type for json stream to application/x-json-stream."

This reverts commit 10ab2089ce189d5bea3f7aaac3b5081471309478.

Conflicts:
	api/client/utils.go
	docs/sources/reference/api/docker_remote_api.md

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 4c6b7cd1b560c72f2c79c28f77644f05b3ee657e
Component: engine
This commit is contained in:
Jessica Frazelle
2014-10-09 13:17:47 -07:00
parent e30e6f7d0c
commit ffd31097c3
5 changed files with 7 additions and 30 deletions

View File

@ -120,10 +120,6 @@ func writeJSON(w http.ResponseWriter, code int, v engine.Env) error {
func streamJSON(job *engine.Job, w http.ResponseWriter, flush bool) {
w.Header().Set("Content-Type", "application/json")
if job.GetenvBool("lineDelim") {
w.Header().Set("Content-Type", "application/x-json-stream")
}
if flush {
job.Stdout.Add(utils.NewWriteFlusher(w))
} else {
@ -993,9 +989,6 @@ func postBuild(eng *engine.Engine, version version.Version, w http.ResponseWrite
}
}
// This needs to be set before calls to streamJSON
job.SetenvBool("lineDelim", version.GreaterThanOrEqualTo("1.15"))
if version.GreaterThanOrEqualTo("1.8") {
job.SetenvBool("json", true)
streamJSON(job, w, true)

View File

@ -275,7 +275,7 @@ func TestGetEvents(t *testing.T) {
if !called {
t.Fatal("handler was not called")
}
assertContentType(r, "application/x-json-stream", t)
assertContentType(r, "application/json", t)
var stdout_json struct {
Since int
Until int