From f36d6d01b5575ac7c2cb4a2cc9428bcfd69d2199 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 9 Nov 2021 10:18:49 +0000 Subject: [PATCH] rc: fix operations/publiclink default for expires parameter Before this change the expires parameter was defaulting to 0 if not provided. This change makes it default to fs.DurationOff which is the same as the `rclone link` command. See: https://forum.rclone.org/t/operations-publiclink-from-dropbox-error-not-autorized/27374 --- fs/operations/rc.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/operations/rc.go b/fs/operations/rc.go index 22aa4ac74..fabb3c7f2 100644 --- a/fs/operations/rc.go +++ b/fs/operations/rc.go @@ -384,7 +384,9 @@ func rcPublicLink(ctx context.Context, in rc.Params) (out rc.Params, err error) } unlink, _ := in.GetBool("unlink") expire, err := in.GetDuration("expire") - if err != nil && !rc.IsErrParamNotFound(err) { + if rc.IsErrParamNotFound(err) { + expire = time.Duration(fs.DurationOff) + } else if err != nil { return nil, err } url, err := PublicLink(ctx, f, remote, fs.Duration(expire), unlink)