diff --git a/registry/client/layer_upload.go b/registry/client/layer_upload.go index 02cc51622..18e5fbabb 100644 --- a/registry/client/layer_upload.go +++ b/registry/client/layer_upload.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "io" + "io/ioutil" "net/http" "os" "time" @@ -33,7 +34,7 @@ func (hlu *httpLayerUpload) handleErrorResponse(resp *http.Response) error { } func (hlu *httpLayerUpload) ReadFrom(r io.Reader) (n int64, err error) { - req, err := http.NewRequest("PATCH", hlu.location, r) + req, err := http.NewRequest("PATCH", hlu.location, ioutil.NopCloser(r)) if err != nil { return 0, err }