diff --git a/lib/s3routes/routes.js b/lib/s3routes/routes.js index f33c5ab0e..b7a77413c 100644 --- a/lib/s3routes/routes.js +++ b/lib/s3routes/routes.js @@ -47,6 +47,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) {