From 22a9ec009b24f567e1feaeb32da25d6b2792c92a Mon Sep 17 00:00:00 2001 From: Sergii Kabashniuk Date: Sun, 29 Jan 2017 15:01:53 +0200 Subject: [PATCH] Fixes work of inspectResponse in case of ContentLength=-1 Signed-off-by: Sergii Kabashniuk --- builder/remote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/remote.go b/builder/remote.go index f3a4329d16..b790301619 100644 --- a/builder/remote.go +++ b/builder/remote.go @@ -129,7 +129,7 @@ func inspectResponse(ct string, r io.ReadCloser, clen int64) (string, io.ReadClo return ct, r, err } - preambleR := bytes.NewReader(preamble) + preambleR := bytes.NewReader(preamble[:rlen]) bodyReader := ioutil.NopCloser(io.MultiReader(preambleR, r)) // Some web servers will use application/octet-stream as the default // content type for files without an extension (e.g. 'Dockerfile')