mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 02:09:55 +08:00
b2: fix uploading empty files with go1.8
This commit is contained in:
parent
84b12574de
commit
175c39e1d0
5
b2/b2.go
5
b2/b2.go
|
@ -1292,6 +1292,11 @@ func (o *Object) Update(in io.Reader, src fs.ObjectInfo) (err error) {
|
|||
},
|
||||
ContentLength: &size,
|
||||
}
|
||||
// for go1.8 (see release notes) we must nil the Body if we want a
|
||||
// "Content-Length: 0" header which b2 requires for all files.
|
||||
if size == 0 {
|
||||
opts.Body = nil
|
||||
}
|
||||
var response api.FileInfo
|
||||
// Don't retry, return a retry error instead
|
||||
err = o.fs.pacer.CallNoRetry(func() (bool, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user