mirror of
https://github.com/rclone/rclone.git
synced 2024-12-01 21:04:56 +01:00
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/
This commit is contained in:
parent
72eb74e94a
commit
65eee674b9
@ -1128,6 +1128,7 @@ func (o *Object) Storable() bool {
|
|||||||
// Open an object for read
|
// Open an object for read
|
||||||
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) {
|
func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.ReadCloser, err error) {
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
|
fs.FixRangeOption(options, o.size)
|
||||||
opts := rest.Opts{
|
opts := rest.Opts{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Path: o.filePath(),
|
Path: o.filePath(),
|
||||||
|
Loading…
Reference in New Issue
Block a user