From 7402cf63540baa22d916320998d34de0deb03087 Mon Sep 17 00:00:00 2001 From: Sun Hongliang Date: Sun, 27 Mar 2016 18:36:16 +0800 Subject: [PATCH] make 2xx response status code compatible with docker 1. POST /images/load from 201 to 200 2. POST /images/{name:.*}/tag from 200 to 201 3. POST /containers/{name:.*}/rename from 200 to 204 Signed-off-by: Sun Hongliang --- api/handlers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/handlers.go b/api/handlers.go index dc76ee8330..22306bd49b 100644 --- a/api/handlers.go +++ b/api/handlers.go @@ -690,7 +690,7 @@ func postImagesCreate(c *context, w http.ResponseWriter, r *http.Request) { // POST /images/load func postImagesLoad(c *context, w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json") - w.WriteHeader(http.StatusCreated) + w.WriteHeader(http.StatusOK) // call cluster to load image on every node wf := NewWriteFlusher(w) @@ -1139,6 +1139,7 @@ func postTagImage(c *context, w http.ResponseWriter, r *http.Request) { httpError(w, err.Error(), http.StatusInternalServerError) } } + w.WriteHeader(http.StatusCreated) } // Proxy a request to a random node @@ -1273,6 +1274,7 @@ func postRenameContainer(c *context, w http.ResponseWriter, r *http.Request) { httpError(w, err.Error(), http.StatusInternalServerError) } } + w.WriteHeader(http.StatusNoContent) }