mirror of
https://github.com/rclone/rclone
synced 2025-01-08 10:26:23 +01: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