From cc5325d22ba1439e987fe7432bc3f8563f1305b8 Mon Sep 17 00:00:00 2001 From: Xun Jiang Date: Tue, 13 Dec 2022 14:51:44 +0800 Subject: [PATCH] Fix: change error code in function isAccessDenied to AccessDenied Signed-off-by: Xun Jiang --- changelog/unreleased/issue-4085 | 1 + internal/backend/s3/s3.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/issue-4085 diff --git a/changelog/unreleased/issue-4085 b/changelog/unreleased/issue-4085 new file mode 100644 index 000000000..f8dba293a --- /dev/null +++ b/changelog/unreleased/issue-4085 @@ -0,0 +1 @@ +Fix error code in function isAccessDenied. \ No newline at end of file diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index 58ae65f97..ad652a206 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -164,7 +164,7 @@ func isAccessDenied(err error) bool { debug.Log("isAccessDenied(%T, %#v)", err, err) var e minio.ErrorResponse - return errors.As(err, &e) && e.Code == "Access Denied" + return errors.As(err, &e) && e.Code == "AccessDenied" } // IsNotExist returns true if the error is caused by a not existing file.