From 2f94790d6718b9f6e7fb3c1032454266add5b440 Mon Sep 17 00:00:00 2001 From: Johan Euphrosine Date: Tue, 22 Oct 2013 11:56:48 -0700 Subject: [PATCH 1/2] registry: fix content-type for PushImageJSONIndex --- docs/registry.go | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/registry.go b/docs/registry.go index 0079215c..74e31739 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -504,6 +504,7 @@ func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData if err != nil { return nil, err } + req.Header.Add("Content-type", "application/json") req.SetBasicAuth(r.authConfig.Username, r.authConfig.Password) req.ContentLength = int64(len(imgListJSON)) req.Header.Set("X-Docker-Token", "true") From 77f6f327044b664514598bc241ef58b51ebe5653 Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Fri, 25 Oct 2013 17:50:40 -0700 Subject: [PATCH 2/2] Removes \\n from debugf calls --- docs/registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/registry.go b/docs/registry.go index 74e31739..9e49f356 100644 --- a/docs/registry.go +++ b/docs/registry.go @@ -499,7 +499,7 @@ func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData } u := fmt.Sprintf("%srepositories/%s/%s", indexEp, remote, suffix) utils.Debugf("[registry] PUT %s", u) - utils.Debugf("Image list pushed to index:\n%s\n", imgListJSON) + utils.Debugf("Image list pushed to index:\n%s", imgListJSON) req, err := r.reqFactory.NewRequest("PUT", u, bytes.NewReader(imgListJSON)) if err != nil { return nil, err @@ -520,7 +520,7 @@ func (r *Registry) PushImageJSONIndex(indexEp, remote string, imgList []*ImgData // Redirect if necessary for res.StatusCode >= 300 && res.StatusCode < 400 { - utils.Debugf("Redirected to %s\n", res.Header.Get("Location")) + utils.Debugf("Redirected to %s", res.Header.Get("Location")) req, err = r.reqFactory.NewRequest("PUT", res.Header.Get("Location"), bytes.NewReader(imgListJSON)) if err != nil { return nil, err