From b9b9bce0db64abdfabc9fbdca26416e40400eb93 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 28 Jun 2018 09:01:17 +0100 Subject: [PATCH] ftp: fix Put mkParentDir failed: 521 for BunnyCDN - fixes #2363 According to RFC 959, error 521 is the correct error return to mean "dir already exists", so add support for this. --- backend/ftp/ftp.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go index a06f977f0..1066fd0b4 100644 --- a/backend/ftp/ftp.go +++ b/backend/ftp/ftp.go @@ -480,6 +480,8 @@ func (f *Fs) mkdir(abspath string) error { switch errX.Code { case ftp.StatusFileUnavailable: // dir already exists: see issue #2181 err = nil + case 521: // dir already exists: error number according to RFC 959: issue #2363 + err = nil } } return err