mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add an additional test to the static test suite
This commit is contained in:
parent
84aea5d24d
commit
ae96aa6e49
2 changed files with 7 additions and 1 deletions
|
@ -340,7 +340,7 @@ charsets_provided(Req, State={Path, _, Extra}) ->
|
|||
no_call;
|
||||
{charset, Module, Function} ->
|
||||
{[Module:Function(Path)], Req, State};
|
||||
{charset, Charset} ->
|
||||
{charset, Charset} when is_binary(Charset) ->
|
||||
{[Charset], Req, State}
|
||||
end.
|
||||
|
||||
|
|
|
@ -195,6 +195,7 @@ execute(Req=#{path := Path}, Env) ->
|
|||
<<"/bad/options">> -> ct_helper:ignore(cowboy_static, content_types_provided, 2);
|
||||
<<"/bad/options/mime">> -> ct_helper:ignore(cowboy_rest, set_content_type, 2);
|
||||
<<"/bad/options/etag">> -> ct_helper:ignore(cowboy_static, generate_etag, 2);
|
||||
<<"/bad/options/charset">> -> ct_helper:ignore(cowboy_static, charsets_provided, 2);
|
||||
_ -> ok
|
||||
end,
|
||||
{ok, Req, Env}.
|
||||
|
@ -279,6 +280,11 @@ bad_options(Config) ->
|
|||
{500, _, _} = do_get("/bad/options", Config),
|
||||
ok.
|
||||
|
||||
bad_options_charset(Config) ->
|
||||
doc("Bad cowboy_static extra options: invalid charset option."),
|
||||
{500, _, _} = do_get("/bad/options/charset", Config),
|
||||
ok.
|
||||
|
||||
bad_options_etag(Config) ->
|
||||
doc("Bad cowboy_static extra options: invalid etag option."),
|
||||
{500, _, _} = do_get("/bad/options/etag", Config),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue