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

Create MIME type tests #60

Open
wthorp opened this issue Oct 13, 2021 · 2 comments
Open

Create MIME type tests #60

wthorp opened this issue Oct 13, 2021 · 2 comments
Labels

Comments

@wthorp
Copy link
Contributor

wthorp commented Oct 13, 2021

Test https://www.storj.io/blog/nft-storage-for-opensea-sdk-with-storj-dcs.

Karl Mozurkewich 28 minutes ago
Does minio have a config to change the mime Type in the response based on file type?

Bill Thorp 21 minutes ago
I believe this is just stored as metadata, and we may be defaulting to the application/octet-stream if the user doesn't set this via their S3 client. It would make sense to try to look it up by file extension, I'm not seeing this logic in my search of the Minio code yet

Karl Mozurkewich 17 minutes ago
Does uplink set content-type when uploading?

Karl Mozurkewich 16 minutes ago
Not sure if aws cli does....

Karl Mozurkewich 11 minutes ago
I'm afk, but would test if aws cli upload to us for an image preserves mime

Karl Mozurkewich 11 minutes ago
Same with uplink in the metadata

Karl Mozurkewich 10 minutes ago
Likely you guys should confirm your test coverage for content type preservation for these workflows

@wthorp
Copy link
Contributor Author

wthorp commented Oct 26, 2021

If someone uploads something with [gateway-mt, linksharing, uplink] does the content/type get set correctly in [gateway-mt, linksharing, uplink]? What if the type is not set, can it be guessed from file extension? We think that Gateway-MT does not guess the content type, but linksharing does. What does Amazon do? -MT should if Amazon does for sure.

@halkyon
Copy link
Contributor

halkyon commented Oct 5, 2022

AWS CLI does guess the type when uploading a file, although it's conceivable it could get that wrong if you don't have the mime types loaded somewhere on your machine (e.g. /etc/mime.types). You can also disable guessing with --no-guess-mime-type, or set --content-type to whatever you want to override any guesses. Storj S3 gateway and AWS S3 will set binary/octet-stream as a default if nothing was sent from the client. S3 SDKs will send application/octet-stream as a default if no ContentType parameter was set when uploading an object, so it's all highly dependent on the client.

It looks like we're doing what S3 does.

I'll look at documenting the above for gateway somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants