mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #1078 from kstaken/fix_json_error
* Remote API: Small fix in /start if empty host config
This commit is contained in:
commit
d1d66b9c5f
1 changed files with 4 additions and 2 deletions
2
api.go
2
api.go
|
@ -555,10 +555,12 @@ func postContainersStart(srv *Server, version float64, w http.ResponseWriter, r
|
||||||
|
|
||||||
// allow a nil body for backwards compatibility
|
// allow a nil body for backwards compatibility
|
||||||
if r.Body != nil {
|
if r.Body != nil {
|
||||||
|
if r.Header.Get("Content-Type") == "application/json" {
|
||||||
if err := json.NewDecoder(r.Body).Decode(hostConfig); err != nil {
|
if err := json.NewDecoder(r.Body).Decode(hostConfig); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if vars == nil {
|
if vars == nil {
|
||||||
return fmt.Errorf("Missing parameter")
|
return fmt.Errorf("Missing parameter")
|
||||||
|
|
Loading…
Add table
Reference in a new issue