Browse Source

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.
Loïc Hoguin 12 years ago
parent
commit
5525369a4a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/cowboy_static.erl

+ 1 - 1
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.