-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Fix MIME type for .wav
and .avi
#150
Conversation
index.js
Outdated
@@ -318,7 +318,7 @@ module.exports = input => { | |||
if (check([0x57, 0x41, 0x56, 0x45], {offset: 8})) { | |||
return { | |||
ext: 'wav', | |||
mime: 'audio/x-wav' | |||
mime: 'audio/wav' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official MIME-type is: audio/vnd.wave
See: https://en.wikipedia.org/wiki/WAV and https://tools.ietf.org/html/rfc2361
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we also need to change video/x-msvideo
to video/vnd.avi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right!
Set AVI to video/vnd.avi
.wav
and .avi
@Borewit @sindresorhus sorry for coming late in the discussion, but I have to say that Firstly, the RFC you mentioned (RFC 2361), is not a standard rfc, but instead an informational rfc, that does not represent an Internet community consensus or recommendation. Secondly, as far as I know, mime types are only used on the web and by browsers to render the content. So, it's logical, to use mime types that browsers know. In my experience with audio files, I have a strong opinion that there isn't an official mime type for .wav and .api files, but in the years emerged an convention to use Here a more long discussion I had on this subject (at the end of the comment I correct myself): patrickmccallum/mimetype-io#18 (comment) Some sources I have used: |
I agree. Practical usage trumps technical specifications in web development. If audio/wav and video/avi work across major browsers and audio/vnd.wave and video/vnd.avi don't, it's clear which MIME types should be used. PR welcome. |
Ok, I will gladly do the pull request. |
Fix issue #149
References: