Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for path-style requests on s3.createMultipartUpload #70

Open
fczuardi opened this issue Oct 11, 2023 · 1 comment
Open

support for path-style requests on s3.createMultipartUpload #70

fczuardi opened this issue Oct 11, 2023 · 1 comment
Labels
question Further information is requested

Comments

@fczuardi
Copy link
Contributor

AWS currently supports both path-style and virtual-hosted–style URLs and even though path-style is to be deprecated soon, other S3-compatible providers have incomplete support for virtual-hosted-style URLs. See https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html#path-style-access

On the lib code, the usage is mixed, on methods like putObject it uses path-style while on others like createMultipartUpload it uses virtual-hosted-style.

Amazon CLI when provided with a --endpoint argument uses path-style for thei own requests 🤣 for example:

aws s3api --endpoint <endpoint url> create-multipart-upload --bucket <bucket name> --key <object key> --debug

shows:

...
POST
/<bucket name>/<object key>
uploads=
...

Should this be a config of the S3Client? Should we do path-styleby default on createMultipartUpload and follow aws-cli implementation?

@oleiade
Copy link
Member

oleiade commented Oct 12, 2023

Hey @fczuardi 👋🏻

Thanks for bringing this to our attention 🙇🏻

The library has received many contributions over time, and there are likely inconsistencies in our implementation indeed. Especially we received contributions to make it possible to use the library against third-party S3-compatible providers such as Ceph, Cloudflare, and DigitalOcean spaces.

I must admit that I implemented the API support based on what was officially documented, and this question of path vs hostname has been coming back and forth since I started this project. AWS APIs are anything but consistent, and if my memory doesn't fail me, we implemented support for path-based only to cater to certain specific providers.

I will have to do a bunch of research to see what makes the most sense to remain somewhat compatible with third-party S3-compatible hosts (which we do not officially support, but as long as it's a low effort to make the library compatible, are willing to cater to).

@oleiade oleiade added the question Further information is requested label Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants