Browse Source

static: Allow passing the mimetype fun as a {M, F} tuple

Loïc Hoguin 12 years ago
parent
commit
6ec12f7ce8
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/cowboy_static.erl

+ 1 - 0
src/cowboy_static.erl

@@ -217,6 +217,7 @@ rest_init(Req, Opts) ->
 	Directory1 = directory_path(Directory),
 	Mimetypes = proplists:get_value(mimetypes, Opts, []),
 	Mimetypes1 = case Mimetypes of
+		{{M, F}, E} -> {fun M:F/2, E};
 		{_, _} -> Mimetypes;
 		[] -> {fun path_to_mimetypes/2, []};
 		[_|_] -> {fun path_to_mimetypes/2, Mimetypes}