1
0
mirror of https://github.com/docker/cli.git synced 2026-01-15 07:40:57 +03:00

Merge pull request #1078 from kstaken/fix_json_error

* Remote API: Small fix in /start if empty host config
Upstream-commit: d1d66b9c5f79dc3c7b6c22c0841d5c2ba96ba51e
Component: engine
This commit is contained in:
Victor Vieux
2013-07-01 16:36:58 -07:00

View File

@@ -555,8 +555,10 @@ func postContainersStart(srv *Server, version float64, w http.ResponseWriter, r
// allow a nil body for backwards compatibility
if r.Body != nil {
if err := json.NewDecoder(r.Body).Decode(hostConfig); err != nil {
return err
if r.Header.Get("Content-Type") == "application/json" {
if err := json.NewDecoder(r.Body).Decode(hostConfig); err != nil {
return err
}
}
}