0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00

fix: cowboy_static mimetypes type

This commit is contained in:
Marko Mindek 2025-01-08 12:06:16 +01:00
parent 022013b6c4
commit 7ca06ffac5

View file

@ -29,7 +29,7 @@
-type extra_charset() :: {charset, module(), function()} | {charset, binary()}.
-type extra_etag() :: {etag, module(), function()} | {etag, false}.
-type extra_mimetypes() :: {mimetypes, module(), function()}
| {mimetypes, binary() | {binary(), binary(), [{binary(), binary()}]}}.
| {mimetypes, binary() | {binary(), binary(), [{binary(), binary()}] | '*'}}.
-type extra() :: [extra_charset() | extra_etag() | extra_mimetypes()].
-type opts() :: {file | dir, string() | binary()}
| {file | dir, string() | binary(), extra()}
@ -332,7 +332,7 @@ forbidden(Req, State) ->
%% Detect the mimetype of the file.
-spec content_types_provided(Req, State)
-> {[{binary(), get_file}], Req, State}
-> {[{binary() | {binary(), binary(), [{binary(), binary()}] | '*'}, get_file}], Req, State}
when State::state().
content_types_provided(Req, State={Path, _, Extra}) when is_list(Extra) ->
case lists:keyfind(mimetypes, 1, Extra) of