diff options
author | Loïc Hoguin <[email protected]> | 2012-10-25 17:21:14 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-10-25 17:21:14 +0200 |
commit | 5525369a4a98ff57f157842106f4adbbe1514d1b (patch) | |
tree | fda01c3ccc28a783ddaaab2b19e1eb2d6481d44d | |
parent | d3277b08ce81d6180ad68dc91d5edda00c426544 (diff) | |
download | cowboy-5525369a4a98ff57f157842106f4adbbe1514d1b.tar.gz cowboy-5525369a4a98ff57f157842106f4adbbe1514d1b.tar.bz2 cowboy-5525369a4a98ff57f157842106f4adbbe1514d1b.zip |
Mimetype lookup expects lowercase extensions
We handle extensions in a case-insensitive manner when looking
for a mimetype for a file. Extensions are thus lowered.
-rw-r--r-- | src/cowboy_static.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl index 3b63afe..724bf33 100644 --- a/src/cowboy_static.erl +++ b/src/cowboy_static.erl @@ -451,7 +451,7 @@ path_to_mimetypes(Filepath, Extensions) when is_binary(Filepath) -> -spec path_to_mimetypes_(binary(), [{binary(), [mimedef()]}]) -> [mimedef()]. path_to_mimetypes_(Ext, Extensions) -> - case lists:keyfind(Ext, 1, Extensions) of + case lists:keyfind(cowboy_bstr:to_lower(Ext), 1, Extensions) of {_, MTs} -> MTs; _Unknown -> default_mimetype() end. |