浏览代码

Fixes work of inspectResponse in case of ContentLength=-1

Signed-off-by: Sergii Kabashniuk <skabashnyuk@codenvy.com>
Sergii Kabashniuk 8 年之前
父节点
当前提交
22a9ec009b
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      builder/remote.go

+ 1 - 1
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')