mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
fix(s3): handle DeleteBucketReplication instead of deleting the whole bucket (#1837)
DELETE /{bucket}?replication fell through the sub-resource switch (which handled
tagging/website/policy/cors/lifecycle/encryption/publicAccessBlock/ownershipControls
but not replication) to the unqualified DeleteBucket, silently destroying the
entire bucket and returning 204.
Real S3 DeleteBucketReplication removes only the replication configuration and
returns 204; a sub-resource-qualified DELETE never deletes the bucket:
https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html
Floci does not model replication, so DeleteBucketReplication is a no-op 204 --
handled explicitly so it cannot reach the bucket-delete fall-through.
Closes #1835
This commit is contained in:
1 parent
3ec4dc65f2
commit
2d250ccf3c
2 files changed
+92
No files matched your search
@@ -314,6 +314,12 @@ public class S3Controller {
|
||||
s3Service.deleteBucketOwnershipControls(bucket);
|
||||
return Response.noContent().build();
|
||||
}
|
||||
if (hasQueryParam(uriInfo, "replication")) {
|
||||
// Floci does not model bucket replication; DeleteBucketReplication is a
|
||||
// no-op that always returns 204, matching real S3. Crucially it must be
|
||||
// handled here so it does NOT fall through to deleting the whole bucket.
|
||||
return Response.noContent().build();
|
||||
}
|
||||
s3Service.deleteBucket(bucket);
|
||||
return Response.noContent().build();
|
||||
} catch (AwsException e) {
|
||||
|
||||
Reference in new issue
Block a user