From 65eee674b9805713e61d048926a7b4bb92228ed4 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 28 Dec 2020 11:31:19 +0000 Subject: [PATCH] webdav: fix Open Range requests to fix 4shared mount Before this change the webdav backend didn't truncate Range requests to the size of the object. Most webdav providers are OK with this (it is RFC compliant), but it causes 4shared to return 500 internal error. Because Range requests are used in mounting, this meant that mounting didn't work for 4shared. This change truncates the Range request to the size of the object. See: https://forum.rclone.org/t/cant-copy-use-files-on-webdav-mount-4shared-that-have-foreign-characters/21334/ --- backend/webdav/webdav.go | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/webdav/webdav.go b/backend/webdav/webdav.go index 10ed2e29d..6f1238e3b 100644 --- a/backend/webdav/webdav.go +++ b/backend/webdav/webdav.go @@ -1128,6 +1128,7 @@ func (o *Object) Storable() bool { // Open an object for read func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) { var resp *http.Response + fs.FixRangeOption(options, o.size) opts := rest.Opts{ Method: "GET", Path: o.filePath(),