Skip to content

Fix a typo in generating URL for us-based regions#17

Open
grishick wants to merge 1 commit intoDeveloper-Amit:masterfrom
grishick:fix-s3-url
Open

Fix a typo in generating URL for us-based regions#17
grishick wants to merge 1 commit intoDeveloper-Amit:masterfrom
grishick:fix-s3-url

Conversation

@grishick
Copy link

First of all, thank you for creating this package! I was using it today and I was getting errors until I realized that there is a typo in how S3 URL is being generated for non-Chinese based regions. With this fix, the package works w/o custom URL on non-Chinese regions.

@jplindgren
Copy link

Thanks for your PR man. It saved me a lot of time. I was not setting the s3Url and did not realize that the URL generated was wrong.
Please, guys, review this PR when you can because it can help a lot of people.

@martinrojas
Copy link

Is this going to be merged at any point?

Copy link

@rjcd95 rjcd95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok based on documentation

@luciancic
Copy link

Thx for the fix and for the info. Just to outline the workaround for everyone while we wait for this get merged:

const bucketName = "my-bucket";
const region = "us-east-1";
const config = {
  bucketName,
  region,
  accessKeyId: "my-access-key-id",
  secretAccessKey: "my-secret-access-key",
  // this is the required line to fix your error
  s3Url: `https://${bucketName}.s3.${region}.amazonaws.com`,
};

const ReactS3Client = new S3(config);
// etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants