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

How do we deal with unknown mime types? #75

Open
tarekziade opened this issue May 3, 2016 · 3 comments
Open

How do we deal with unknown mime types? #75

tarekziade opened this issue May 3, 2016 · 3 comments
Labels
question stale For marking issues as stale. Labeled issues will be closed soon if label is not removed.

Comments

@tarekziade
Copy link
Contributor

As seen on Fennec, some boxes just don't have mimetypes registered see:

pocmo/Fennec-DLC-Catalog@b6abf51

we should deal with this in kinto-attachement. https://github.com/Kinto/kinto-attachment/blob/master/scripts/upload.py#L61

maybe by raising an error ? another option is to guess it on the server-side in Kinto when it's not provided by the client maybe ?

@Natim
Copy link
Member

Natim commented May 3, 2016

I think if no mimetype is provided in the client call we should probably fallback to application/octet-stream if we can guess with a streaming api it is fine but we if we need to open large file on the server side to guess, it can have a huge impact on performances.

That's why we wanted to have the client giving us the mimetype.

@Natim Natim changed the title deal with unknown mime types How do we deal with unknown mime types? May 3, 2016
@Natim Natim added the question label May 3, 2016
@tarekziade
Copy link
Contributor Author

tarekziade commented May 3, 2016

if we need to open large file on the server side to guess, it can have a huge impact on performances.
That's why we wanted to have the client giving us the mimetype.

I am not sure that's relevant for the S3 backend (the performance part)

They don't enforce the content-type btw

http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUT.html

I have not tested this but I think when you get a file in S3 where the Content-Type was not set, application/octet-stream is the default, so a fallback to that value seems a good idea

@leplatrem
Copy link
Contributor

Does this only affects the upload script ?

@alexcottner alexcottner added the stale For marking issues as stale. Labeled issues will be closed soon if label is not removed. label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question stale For marking issues as stale. Labeled issues will be closed soon if label is not removed.
Projects
None yet
Development

No branches or pull requests

4 participants