From 30ccf9a39801522a2c3326ca34b533fecdd677d3 Mon Sep 17 00:00:00 2001 From: Rahul Padigela Date: Wed, 22 May 2019 16:54:10 -0700 Subject: [PATCH] bugfix: S3C-2172 change error message for compatibility When a delete bucket request is sent with an invalid bucket name the server returns NoSuchBucket instead of InvalidBucketName error to be compatible with AWS S3. --- lib/s3routes/routes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/s3routes/routes.js b/lib/s3routes/routes.js index 20ff55e1e..9fd296b3b 100644 --- a/lib/s3routes/routes.js +++ b/lib/s3routes/routes.js @@ -45,6 +45,9 @@ function checkBucketAndKey(bucketName, objectKey, method, reqQuery, if (bucketName !== undefined && routesUtils.isValidBucketName(bucketName, blacklistedPrefixes.bucket) === false) { log.debug('invalid bucket name', { bucketName }); + if (method === 'DELETE') { + return errors.NoSuchBucket; + } return errors.InvalidBucketName; } if (objectKey !== undefined) {