Skip to content

Commit

Permalink
fix: exclude locationconstraint from s3 createBucket in us-east-1 (#4666
Browse files Browse the repository at this point in the history
)
  • Loading branch information
kuhe authored Aug 14, 2024
1 parent 03debbd commit a1c0ff7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-s3-9367ca5d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "s3",
"description": "omit locationConstraint in createBucket to us-east-1"
}
6 changes: 5 additions & 1 deletion lib/services/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,11 @@ AWS.util.update(AWS.S3.prototype, {
// mutate params object argument passed in by user
var copiedParams = AWS.util.copy(params);

if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {
if (
this.config.region !== 'us-east-1'
&& hostname !== this.api.globalEndpoint
&& !params.CreateBucketConfiguration
) {
copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region };
}
return this.makeRequest('createBucket', copiedParams, callback);
Expand Down
3 changes: 2 additions & 1 deletion scripts/region-checker/allowlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var allowlist = {
819,
820,
821,
826
826,
1266
],
'/token/sso_token_provider.js': [
60
Expand Down

0 comments on commit a1c0ff7

Please sign in to comment.