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

Fix MIME type for .wav and .avi #150

Merged
merged 2 commits into from
Jul 8, 2018
Merged

Fix MIME type for .wav and .avi #150

merged 2 commits into from
Jul 8, 2018

Conversation

Borewit
Copy link
Collaborator

@Borewit Borewit commented Jun 30, 2018

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'
Copy link
Owner

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

Copy link
Owner

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

Copy link
Collaborator Author

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
@Borewit Borewit changed the title Map WAV to audio/wav. Map WAV to audio/vnd.wave & AVI to video/vnd.avi. Jul 4, 2018
@sindresorhus sindresorhus changed the title Map WAV to audio/vnd.wave & AVI to video/vnd.avi. Fix MIME type for .wav and .avi Jul 8, 2018
@sindresorhus sindresorhus merged commit bad006f into sindresorhus:master Jul 8, 2018
@Borewit Borewit deleted the issue/149 branch July 9, 2018 17:16
@luckv
Copy link
Contributor

luckv commented Dec 26, 2023

@Borewit @sindresorhus sorry for coming late in the discussion, but I have to say that audio/vnd.wave and video/vnd.avi are not official mime types, but instead should be used audio/wav and video/avi, and I tell you why.

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, audio/vnd.wave isn't recognized by any major web browser (google chrome, mozilla firefox, safari), but audio/wav is.

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 audio/wav and video/avi. If it's not, I will gladly change my opinion.

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:

@sindresorhus
Copy link
Owner

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.

@luckv
Copy link
Contributor

luckv commented Dec 30, 2023

Ok, I will gladly do the pull request.

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

Successfully merging this pull request may close these issues.

3 participants