Selaa lähdekoodia

fix content-type for legacy

Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Victor Vieux 11 vuotta sitten
vanhempi
commit
0b403b3531
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2 0
      api/api.go

+ 2 - 0
api/api.go

@@ -247,6 +247,7 @@ func getImagesJSON(eng *engine.Engine, version float64, w http.ResponseWriter, r
 				outsLegacy.Add(outLegacy)
 				outsLegacy.Add(outLegacy)
 			}
 			}
 		}
 		}
+		w.Header().Set("Content-Type", "application/json")
 		if _, err := outsLegacy.WriteListTo(w); err != nil {
 		if _, err := outsLegacy.WriteListTo(w); err != nil {
 			return err
 			return err
 		}
 		}
@@ -350,6 +351,7 @@ func getContainersJSON(eng *engine.Engine, version float64, w http.ResponseWrite
 			ports.ReadListFrom([]byte(out.Get("Ports")))
 			ports.ReadListFrom([]byte(out.Get("Ports")))
 			out.Set("Ports", displayablePorts(ports))
 			out.Set("Ports", displayablePorts(ports))
 		}
 		}
+		w.Header().Set("Content-Type", "application/json")
 		if _, err = outs.WriteListTo(w); err != nil {
 		if _, err = outs.WriteListTo(w); err != nil {
 			return err
 			return err
 		}
 		}