diff options
author | Loïc Hoguin <[email protected]> | 2012-11-29 11:18:57 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2012-11-29 11:18:57 +0100 |
commit | 6ec12f7ce87eb51564d01361ef82dd725036514e (patch) | |
tree | fed6702c261f6f27393809a5fe78a83236e9bb45 /src | |
parent | 71420169554375eba4d9c2a7c11d87bd944748cc (diff) | |
download | cowboy-6ec12f7ce87eb51564d01361ef82dd725036514e.tar.gz cowboy-6ec12f7ce87eb51564d01361ef82dd725036514e.tar.bz2 cowboy-6ec12f7ce87eb51564d01361ef82dd725036514e.zip |
static: Allow passing the mimetype fun as a {M, F} tuple
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_static.erl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl index 1b4ff89..305d6bd 100644 --- a/src/cowboy_static.erl +++ b/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} |