diff options
author | Loïc Hoguin <[email protected]> | 2019-04-03 15:53:16 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-04-03 15:53:16 +0200 |
commit | ad005b7d96441826a6fad1f6473ce69d11f53ca4 (patch) | |
tree | 4736437c7876e33b473ba4b1638caeba01b72aa6 /src | |
parent | 860719db3bf89aeba074c06ebb0a076051d6ab98 (diff) | |
download | cowlib-ad005b7d96441826a6fad1f6473ce69d11f53ca4.tar.gz cowlib-ad005b7d96441826a6fad1f6473ce69d11f53ca4.tar.bz2 cowlib-ad005b7d96441826a6fad1f6473ce69d11f53ca4.zip |
Don't use string:lowercase yet, not available in OTP-192.7.2
Diffstat (limited to 'src')
-rw-r--r-- | src/cow_mimetypes.erl | 6 | ||||
-rw-r--r-- | src/cow_mimetypes.erl.src | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/cow_mimetypes.erl b/src/cow_mimetypes.erl index 35f4c5f..07fc69f 100644 --- a/src/cow_mimetypes.erl +++ b/src/cow_mimetypes.erl @@ -23,7 +23,8 @@ all(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> all_ext(string:lowercase(Ext)) + %% @todo Convert to string:lowercase on OTP-20+. + << $., Ext/binary >> -> all_ext(list_to_binary(string:to_lower(binary_to_list(Ext)))) end. %% @doc Return the mimetype for a Web related file by looking at its extension. @@ -32,7 +33,8 @@ all(Path) -> web(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> web_ext(string:lowercase(Ext)) + %% @todo Convert to string:lowercase on OTP-20+. + << $., Ext/binary >> -> web_ext(list_to_binary(string:to_lower(binary_to_list(Ext)))) end. %% Internal. diff --git a/src/cow_mimetypes.erl.src b/src/cow_mimetypes.erl.src index dafbbde..2c57834 100644 --- a/src/cow_mimetypes.erl.src +++ b/src/cow_mimetypes.erl.src @@ -23,7 +23,8 @@ all(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> all_ext(string:lowercase(Ext)) + %% @todo Convert to string:lowercase on OTP-20+. + << $., Ext/binary >> -> all_ext(list_to_binary(string:to_lower(binary_to_list(Ext)))) end. %% @doc Return the mimetype for a Web related file by looking at its extension. @@ -32,7 +33,8 @@ all(Path) -> web(Path) -> case filename:extension(Path) of <<>> -> {<<"application">>, <<"octet-stream">>, []}; - << $., Ext/binary >> -> web_ext(string:lowercase(Ext)) + %% @todo Convert to string:lowercase on OTP-20+. + << $., Ext/binary >> -> web_ext(list_to_binary(string:to_lower(binary_to_list(Ext)))) end. %% Internal. |