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
This commit is contained in:
Nick Craig-Wood 2024-07-10 12:03:14 +01:00
parent 754e53dbcc
commit 75ef84fdf6

View File

@ -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 := o.fs.newOptsCall(o.id, "GET", "/content")
opts.Options = options opts.Options = options
if o.fs.opt.AVOverride { 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 // Make a note of the redirect target as we need to call it without Auth
var redirectReq *http.Request var redirectReq *http.Request