-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Related issue:
#5490
Related Code
https://github.com/aws/aws-sdk-js-v3/blob/main/lib/lib-storage/src/Upload.ts#L171-L181
Why I think this is a bug:
- The library should be smart enough to use path style when bucket name includes dot. It can do so. This allows the same S3 client instance can be used to interact with multiple buckets, without forcing path style for all the buckets.
- This is inconsistent with multipart upload, the location of multipart upload output will use path style when bucket name includes dot, even if
forcePathStyle
is not set. - This is inconsistent with the behavior of V2.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/lib-storage@3.679.0
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
v18.17.0
Reproduction Steps
Use an s3 bucket with dots in its name
const s3Client: S3Client = new S3({
credentials,
region: "us-west-2",
})
const upload = new Upload({
params: {
Bucket: "test.bucket.name",
Key: "test/test.txt",
Body: "aaaa",
ContentType: "text/plain",
ContentDisposition: "inline",
},
client: s3Client,
partSize: 5 * 1024 * 1024,
})
const result = await upload.done()
console.log(JSON.stringify(result, null, 2))
Observed Behavior
the location returned is not an accessible url
eg. https://example.bucket.s3.ap-south-1.amazonaws.com/key
Expected Behavior
it should use path style, eg. https://s3.ap-south-1.amazonaws.com/example.bucket/key
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp3This is a minor priority issueThis is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.