Skip to content

Commit 466930b

Browse files
committed
rgw: S3 Delete Bucket Policy should return 204 on success
Currently, RGW returns a 200 on a successful DELETE on a bucket policy but the S3 API expects a 204: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketPolicy.html The sample response in the example above is a 204. This patch checks the op_ret in `RGWDeleteBucketPolicy::send_response()` and on a success we turn it to a 204 (or STATUS_NO_CONTENT). Fixes: https://tracker.ceph.com/issues/69539 Signed-off-by: Simon Jürgensmeyer <[email protected]>
1 parent f992060 commit 466930b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/rgw/rgw_op.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8582,6 +8582,10 @@ void RGWGetBucketPolicy::execute(optional_yield y)
85828582

85838583
void RGWDeleteBucketPolicy::send_response()
85848584
{
8585+
if (!op_ret) {
8586+
/* A successful Delete Bucket Policy should return a 204 on success */
8587+
op_ret = STATUS_NO_CONTENT;
8588+
}
85858589
if (op_ret) {
85868590
set_req_state_err(s, op_ret);
85878591
}
@@ -9257,4 +9261,3 @@ void rgw_slo_entry::decode_json(JSONObj *obj)
92579261
JSONDecoder::decode_json("etag", etag, obj);
92589262
JSONDecoder::decode_json("size_bytes", size_bytes, obj);
92599263
};
9260-

0 commit comments

Comments
 (0)