storj / gateway-st

Single-tenant, S3-compatible server to interact with the Storj network
Apache License 2.0
71 stars 19 forks source link

Missing headers in delete response when versioning is suspended #85

Open jewharton opened 10 hours ago

jewharton commented 10 hours ago

Description

The x-amz-delete-marker and x-amz-version-id headers are missing from responses to DeleteObject requests that are made against buckets with versioning suspended.

Reproduction steps

  1. Create a bucket.
  2. Enable bucket versioning.
  3. Suspend bucket versioning.
  4. Upload an object.
  5. Delete the object, specifying only its name and not its version so that a delete marker will be created.
  6. Inspect the deletion response.

Using AWS CLI

aws s3api create-bucket --bucket my-bucket
aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Enabled
aws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=Suspended
aws s3api put-object --bucket my-bucket --body test.txt --key test.txt
aws s3api delete-object --bucket my-bucket --key test.txt

Expected behavior

I expected to receive a response containing the missing headers. In AWS CLI, the output should resemble this:

{
    "DeleteMarker": true,
    "VersionId": "null"
}

Actual behavior

The response does not contain the header, and the AWS CLI output is empty.

Environment

Links

jewharton commented 10 hours ago

This means that unversioned delete markers (delete markers made in versioning-suspended buckets) will never have their version IDs passed to MinIO in this situation.