mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
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.
This commit is contained in:
parent
d3277b08ce
commit
5525369a4a
1 changed files with 1 additions and 1 deletions
|
@ -451,7 +451,7 @@ path_to_mimetypes(Filepath, Extensions) when is_binary(Filepath) ->
|
||||||
|
|
||||||
-spec path_to_mimetypes_(binary(), [{binary(), [mimedef()]}]) -> [mimedef()].
|
-spec path_to_mimetypes_(binary(), [{binary(), [mimedef()]}]) -> [mimedef()].
|
||||||
path_to_mimetypes_(Ext, Extensions) ->
|
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;
|
{_, MTs} -> MTs;
|
||||||
_Unknown -> default_mimetype()
|
_Unknown -> default_mimetype()
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue