From 06ecfb771aa5d63b0678cf287ce97ce10e4aed6e Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 29 Jan 2018 17:43:55 +0100 Subject: [PATCH] bucketExists: return consistent NotFound error code bucketExists() returns NoSucketBucket or NotFound error code depending if region is specified in Minio Client initialization. This PR always specifies us-east-1 region in HEAD bucket call to avoid the internal code fetching for bucket location and returning NoSuchBucket error code. --- src/main/minio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/minio.js b/src/main/minio.js index 16cdf25e6..accddea77 100644 --- a/src/main/minio.js +++ b/src/main/minio.js @@ -647,7 +647,7 @@ export class Client { throw new TypeError('callback should be of type "function"') } var method = 'HEAD' - this.makeRequest({method, bucketName}, '', 200, '', false, cb) + this.makeRequest({method, bucketName}, '', 200, 'us-east-1', false, cb) } // Remove a bucket.