]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: return 204 on bucket public access block deletion
authorSeena Fallah <seenafallah@gmail.com>
Tue, 20 Feb 2024 14:54:06 +0000 (15:54 +0100)
committerCasey Bodley <cbodley@redhat.com>
Thu, 7 Mar 2024 16:12:54 +0000 (11:12 -0500)
According to AWS doc (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html#API_DeletePublicAccessBlock_ResponseSyntax) 204 shall be returned on delete request.

Fixes: https://tracker.ceph.com/issues/64492
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 48a454971c9979dfd9a95cc9619ca864aeda26a5)

src/rgw/rgw_op.cc

index ab19a15dbc5835f8a93e4934b2f8a67ffdc86ce8..9e32c49828090d6627e61fdff489cd416b260707 100644 (file)
@@ -9017,9 +9017,12 @@ void RGWGetBucketPublicAccessBlock::execute(optional_yield y)
 
 void RGWDeleteBucketPublicAccessBlock::send_response()
 {
-  if (op_ret) {
-    set_req_state_err(s, op_ret);
+  if (!op_ret) {
+    /* A successful Delete request should return a 204 */
+    op_ret = STATUS_NO_CONTENT;
   }
+
+  set_req_state_err(s, op_ret);
   dump_errno(s);
   end_header(s);
 }