From d85e5b10bb7f8928e22baab9903c1abe73db7ea2 Mon Sep 17 00:00:00 2001 From: Aleksey Kravchenko Date: Tue, 11 Mar 2025 12:08:58 +0300 Subject: [PATCH] [#603] Fix GetBucketPolicyStatus case sensitivity According to the AWS documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html), the `IsPublic` tag value should be in uppercase. However, the `aws-cli` utility interprets such responses as always `false`. To avoid incorrect interpretation, we now return the tag value in lowercase. Signed-off-by: Aleksey Kravchenko --- api/handler/response.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/handler/response.go b/api/handler/response.go index eb21b2af6..12d8a5465 100644 --- a/api/handler/response.go +++ b/api/handler/response.go @@ -67,9 +67,12 @@ type PolicyStatus struct { type PolicyStatusIsPublic string +// According to the AWS documentation (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html), +// the `IsPublic` tag value should be in uppercase. However, the `aws-cli` utility interprets such responses +// as always `false`. To avoid incorrect interpretation, we return the tag value in lowercase. const ( - PolicyStatusIsPublicFalse = "FALSE" - PolicyStatusIsPublicTrue = "TRUE" + PolicyStatusIsPublicFalse = "false" + PolicyStatusIsPublicTrue = "true" ) // AccessControlPolicy contains ACL.