ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
279 stars 173 forks source link

force extension of filename into lower char #72

Closed DavidAlphaFox closed 5 years ago

DavidAlphaFox commented 5 years ago

Dear author. I use cow_mimetypes to detect mimetypes, but sometime the extension of filename in upper char on filesystem. So I modify cow_mimetypes, force extension of filename into lower char.

essen commented 5 years ago

Agree. Maybe use string:lowercase/1 instead though.

DavidAlphaFox commented 5 years ago

Agree, I fixed this. If the version of OTP is 20 or greater, it will use string:lowercase. Otherwise it will use through.

essen commented 5 years ago

There's no need to support versions below 20, 19 will be dropped soon.

DavidAlphaFox commented 5 years ago

OK, I revert the commit. Only support OTP 20 or greater.

essen commented 5 years ago

I've merged this locally and this will be part of the next patch release. I've also added a test in Cowboy for cowboy_static relating to this. Thanks!