]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rgw: S3 Put Bucket Policy should return 204 on success 38420/head
authorMatthew Oliver <moliver@suse.com>
Thu, 14 May 2020 01:31:56 +0000 (11:31 +1000)
committerNathan Cutler <ncutler@suse.com>
Thu, 3 Dec 2020 11:31:24 +0000 (12:31 +0100)
commitb0c2dcae730870e9a39ce303dc0b0d3ebdc58348
treebf8f62f8c40ac0700bead17af79a1b1aca364437
parent00b4001ef48c45aa8476eced0d4e2aeb08b6856f
rgw: S3 Put Bucket Policy should return 204 on success

Currently RGW returns a 200 on a successful PUT on a bucket policy but
the S3 api extects a 204, which makes sense as it's a success without
any contect returned:

   https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTpolicy.html

The sample response in the example above is a 204.

This patch checks the op_ret in `RGWPutBucketPolicy::send_response()`
and on a success we turn it to a 204 (or STATUS_NO_CONTENT).

Fixes: https://tracker.ceph.com/issues/45467
Signed-off-by: Matthew Oliver <moliver@suse.com>
(cherry picked from commit 7fddff78c98ef9a3c73581b892c7dfa04b64cdb3)
src/rgw/rgw_op.cc