From 886dfd23e24dd9e03c5ffcca2b8eca1a6fe7b328 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 23 Mar 2021 10:22:56 +0000 Subject: [PATCH] fichier: check if more than one upload link is returned #5152 --- backend/fichier/fichier.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/fichier/fichier.go b/backend/fichier/fichier.go index 4dcef4eee..5a1c2aea2 100644 --- a/backend/fichier/fichier.go +++ b/backend/fichier/fichier.go @@ -348,8 +348,10 @@ func (f *Fs) putUnchecked(ctx context.Context, in io.Reader, remote string, size return nil, err } - if len(fileUploadResponse.Links) != 1 { - return nil, errors.New("unexpected amount of files") + if len(fileUploadResponse.Links) == 0 { + return nil, errors.New("upload response not found") + } else if len(fileUploadResponse.Links) > 1 { + fs.Debugf(remote, "Multiple upload responses found, using the first") } link := fileUploadResponse.Links[0]