From 98804cb860f158f94002be3223d9d5c5fad4dbb5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Fri, 7 Oct 2016 12:16:25 +0100 Subject: [PATCH] b2: Fix seek producing corrupted file errors --- b2/b2.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/b2/b2.go b/b2/b2.go index 5b9558b20..f28630b83 100644 --- a/b2/b2.go +++ b/b2/b2.go @@ -1121,6 +1121,10 @@ func (o *Object) Open(options ...fs.OpenOption) (in io.ReadCloser, err error) { fs.Debug(o, "Reading sha1 from info - %q", o.sha1) } } + // Don't check length or hash on partial content + if resp.StatusCode == http.StatusPartialContent { + return resp.Body, nil + } return newOpenFile(o, resp), nil }