mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00:00
rest: fix upload of 0 length files
Before this change if ContentLength was set in the options but 0 then we would upload using chunked encoding. Fix this to always upload with a "Content-Length" header even if the size is 0. Remove workarounds for this from b2 and onedrive backends. This fixes the issue for the webdav backend described here: https://forum.rclone.org/t/code-500-errors-with-webdav-nextcloud/8440/
This commit is contained in:
@@ -1560,10 +1560,6 @@ func (o *Object) uploadSinglepart(in io.Reader, size int64, modTime time.Time) (
|
||||
}
|
||||
}
|
||||
|
||||
if size == 0 {
|
||||
opts.Body = nil
|
||||
}
|
||||
|
||||
err = o.fs.pacer.Call(func() (bool, error) {
|
||||
resp, err = o.fs.srv.CallJSON(&opts, nil, &info)
|
||||
if apiErr, ok := err.(*api.Error); ok {
|
||||
|
||||
Reference in New Issue
Block a user