Skip to content

Commit a1c0ff7

Browse files
authored
fix: exclude locationconstraint from s3 createBucket in us-east-1 (#4666)
1 parent 03debbd commit a1c0ff7

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "s3",
4+
"description": "omit locationConstraint in createBucket to us-east-1"
5+
}

lib/services/s3.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,11 @@ AWS.util.update(AWS.S3.prototype, {
12631263
// mutate params object argument passed in by user
12641264
var copiedParams = AWS.util.copy(params);
12651265

1266-
if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {
1266+
if (
1267+
this.config.region !== 'us-east-1'
1268+
&& hostname !== this.api.globalEndpoint
1269+
&& !params.CreateBucketConfiguration
1270+
) {
12671271
copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region };
12681272
}
12691273
return this.makeRequest('createBucket', copiedParams, callback);

scripts/region-checker/allowlist.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ var allowlist = {
5050
819,
5151
820,
5252
821,
53-
826
53+
826,
54+
1266
5455
],
5556
'/token/sso_token_provider.js': [
5657
60

0 commit comments

Comments
 (0)