versity / versitygw

versity s3 gateway
https://www.versity.com/products/versitygw/
Apache License 2.0
180 stars 23 forks source link

[Bug] - Incorrect error message when create-multipart-upload is attempted without bucket and key #899

Open lrm25 opened 1 week ago

lrm25 commented 1 week ago

Describe the bug Direct, the following error is returned when the user attempts this without a bucket and key:

<?xml version="1.0" encoding="UTF-8"?>
   <Error><Code>MethodNotAllowed</Code><Message>The specified method is not allowed against this resource.</Message><Method>POST</Method><ResourceType>SERVICE</ResourceType><RequestId>TY9SS54WJDPB4BC3</RequestId><HostId>caPOcl5j2T58DD2bfWAjqNMfN0uiTMinbk/yAjHvARq/kD05m7G1i8YlbBu5/f2mBFK7bVQk3xc=</HostId></Error>

And with versitygw:

<?xml version="1.0" encoding="UTF-8"?>
   <Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist.</Message><Resource></Resource><RequestId></RequestId><HostId></HostId></Error>

However, no bucket is specified at all, so this is an incorrect error message.

To Reproduce

  1. Start versity, e.g.: ./versitygw --access=******** --secret=******** --region=us-east-1 --cert /Users/lukemccrone/devel/versitygw/cert.pem --key /Users/lukemccrone/devel/versitygw/versitygw.pem posix --versioning-dir /tmp/versioning /tmp/gw
  2. Run create-multipart-upload script (https://github.com/versity/versitygw/blob/test_cmdline_lock_versioning/tests/rest_scripts/create_multipart_upload.sh), but leave "$BUCKET_NAME" and "$OBJECT_KEY" empty, and delete slash between the two in canonical request string and curl command.

Expected behavior As with direct, versitygw reports 405.

Server Version Version : v1.0.7 Build : b921246 BuildTime: 2024-10-16_05:47:24PM Darwin Lukes-MacBook-Pro.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64

jonaustin09 commented 3 days ago

908 Will resolve this.