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

Many mime types not recognized #125

Open
ivanjaros opened this issue Jan 10, 2023 · 0 comments
Open

Many mime types not recognized #125

ivanjaros opened this issue Jan 10, 2023 · 0 comments

Comments

@ivanjaros
Copy link

ivanjaros commented Jan 10, 2023

Like audio/wav won't match the audio/x-wav even though it is perfectly valid mime type.
The matchers are too strict when there are multiple variants for many mime types that are valid.

var (
	TypeMidi = newType("mid", "audio/midi")
	TypeMp3  = newType("mp3", "audio/mpeg")
	TypeM4a  = newType("m4a", "audio/m4a")
	TypeOgg  = newType("ogg", "audio/ogg")
	TypeFlac = newType("flac", "audio/x-flac") <---
	TypeWav  = newType("wav", "audio/x-wav") <---
	TypeAmr  = newType("amr", "audio/amr")
	TypeAac  = newType("aac", "audio/aac")
	TypeAiff = newType("aiff", "audio/x-aiff") <---
)

var (
	TypeMp4  = newType("mp4", "video/mp4")
	TypeM4v  = newType("m4v", "video/x-m4v") <---
	TypeMkv  = newType("mkv", "video/x-matroska") <---
	TypeWebm = newType("webm", "video/webm")
	TypeMov  = newType("mov", "video/quicktime")
	TypeAvi  = newType("avi", "video/x-msvideo") <---
	TypeWmv  = newType("wmv", "video/x-ms-wmv") <---
	TypeMpeg = newType("mpg", "video/mpeg")
	TypeFlv  = newType("flv", "video/x-flv") <---
	Type3gp  = newType("3gp", "video/3gpp")
)

This makes IsMIMESupported unusable. For example when uploading files from web browsers. The mime won't match and upload fails.

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

No branches or pull requests

1 participant