From 75ef84fdf6b30cb30fbe8b761971276d93e96c7b Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 10 Jul 2024 12:03:14 +0100 Subject: [PATCH] onedrive: fix --onedrive-av-override The AVOverride=1 parameter doesn't always seem to work. The browser sends avcmd=1 though, so send that as well. Since this flag isn't documented anywhere this is a guess as to the correct behaviour. Fixes #7934 --- backend/onedrive/onedrive.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/onedrive/onedrive.go b/backend/onedrive/onedrive.go index abdffdf1c..88784e2ca 100644 --- a/backend/onedrive/onedrive.go +++ b/backend/onedrive/onedrive.go @@ -2270,7 +2270,8 @@ func (o *Object) Open(ctx context.Context, options ...fs.OpenOption) (in io.Read opts := o.fs.newOptsCall(o.id, "GET", "/content") opts.Options = options if o.fs.opt.AVOverride { - opts.Parameters = url.Values{"AVOverride": {"1"}} + // AVOverride=1 works normally but the browser sends avcmd=1 + opts.Parameters = url.Values{"AVOverride": {"1"}, "avcmd": {"1"}} } // Make a note of the redirect target as we need to call it without Auth var redirectReq *http.Request