From 853efc34baeea50a814bdc57f2e40cb6cd28ec2a Mon Sep 17 00:00:00 2001 From: "David.Gao" Date: Mon, 21 Jan 2019 23:26:31 +0800 Subject: Lowercase file extension in cow_mimetypes --- src/cow_mimetypes.erl | 4 ++-- src/cow_mimetypes.erl.src | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cow_mimetypes.erl b/src/cow_mimetypes.erl index c2e6ef4..35f4c5f 100644 --- a/src/cow_mimetypes.erl +++ b/src/cow_mimetypes.erl @@ -23,7 +23,7 @@ all(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> all_ext(Ext) + << $., Ext/binary >> -> all_ext(string:lowercase(Ext)) end. %% @doc Return the mimetype for a Web related file by looking at its extension. @@ -32,7 +32,7 @@ all(Path) -> web(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> web_ext(Ext) + << $., Ext/binary >> -> web_ext(string:lowercase(Ext)) end. %% Internal. diff --git a/src/cow_mimetypes.erl.src b/src/cow_mimetypes.erl.src index 46ec112..dafbbde 100644 --- a/src/cow_mimetypes.erl.src +++ b/src/cow_mimetypes.erl.src @@ -23,7 +23,7 @@ all(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> all_ext(Ext) + << $., Ext/binary >> -> all_ext(string:lowercase(Ext)) end. %% @doc Return the mimetype for a Web related file by looking at its extension. @@ -32,7 +32,7 @@ all(Path) -> web(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> web_ext(Ext) + << $., Ext/binary >> -> web_ext(string:lowercase(Ext)) end. %% Internal. -- cgit v1.2.3