mirror of https://github.com/docker/docs.git
Adding check for content-type header
This commit is contained in:
parent
b37f7d49d8
commit
d8d33e8b8b
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…
Reference in New Issue