From 40abae7caa64d766b6eceab4f51106121b675523 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev Date: Wed, 17 Nov 2021 14:42:24 +0500 Subject: [PATCH] Avoid forbiddening for HeadBucketHandler if owners are specified https://github.com/chrislusf/seaweedfs/issues/2434 --- weed/s3api/s3api_bucket_handlers.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go index e8ca20cb0..b932edbac 100644 --- a/weed/s3api/s3api_bucket_handlers.go +++ b/weed/s3api/s3api_bucket_handlers.go @@ -177,8 +177,8 @@ func (s3a *S3ApiServer) HeadBucketHandler(w http.ResponseWriter, r *http.Request bucket, _ := getBucketAndObject(r) glog.V(3).Infof("HeadBucketHandler %s", bucket) - if err := s3a.checkBucket(r, bucket); err != s3err.ErrNone { - s3err.WriteErrorResponse(w, r, err) + if entry, err := s3a.getEntry(s3a.option.BucketsPath, bucket); entry == nil || err == filer_pb.ErrNotFound { + s3err.WriteErrorResponse(w, r, s3err.ErrNoSuchBucket) return }