Updated postContainersCreate to use writeJSON.
This commit is contained in:
parent
33e4d73629
commit
d48ea32186
1 changed files with 1 additions and 8 deletions
9
api.go
9
api.go
|
@ -535,14 +535,7 @@ func postContainersCreate(srv *Server, version float64, w http.ResponseWriter, r
|
|||
out.Warnings = append(out.Warnings, "IPv4 forwarding is disabled.")
|
||||
}
|
||||
|
||||
b, err := json.Marshal(out)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write(b)
|
||||
return nil
|
||||
return writeJSON(w, http.StatusCreated, out)
|
||||
}
|
||||
|
||||
func postContainersRestart(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
|
|
Loading…
Add table
Reference in a new issue