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

Casing issues with some mimes #38

Closed
IceDragon200 opened this issue Aug 28, 2020 · 3 comments · Fixed by #39
Closed

Casing issues with some mimes #38

IceDragon200 opened this issue Aug 28, 2020 · 3 comments · Fixed by #39

Comments

@IceDragon200
Copy link
Contributor

The fatest way to demonstrate the problem:

iex(2)> MIME.extensions("audio/amr")
[]
iex(3)> MIME.extensions("audio/AMR")
["amr"]

I believe MIME should at least normalize (lowercase) all it's compiled types, and possibly lowercase it's input to match, unless the latter creates a performance issue

Expectation

MIME.extensions/1 works with any casing thrown at it

@josevalim
Copy link
Member

You are correct, the spec says they are not case sensitive, we should probably include both in such cases.

@josevalim
Copy link
Member

Btw, a PR is welcome!

@IceDragon200
Copy link
Contributor Author

Sure thing, I'll have one up shortly

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 a pull request may close this issue.

2 participants