diff options
author | Loïc Hoguin <[email protected]> | 2016-06-13 17:35:26 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2016-06-13 17:35:26 +0200 |
commit | 352cfce6635fde32348173110f35539bb8459d3f (patch) | |
tree | bebb35b203064c2b9fe0cb1b1d3bda6ecc4e7e77 /test/examples_SUITE.erl | |
parent | 6f75598b70801bbfb6828e5367bc7ed7477ad915 (diff) | |
download | cowboy-352cfce6635fde32348173110f35539bb8459d3f.tar.gz cowboy-352cfce6635fde32348173110f35539bb8459d3f.tar.bz2 cowboy-352cfce6635fde32348173110f35539bb8459d3f.zip |
Fix markdown_middleware example
Diffstat (limited to 'test/examples_SUITE.erl')
-rw-r--r-- | test/examples_SUITE.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/examples_SUITE.erl b/test/examples_SUITE.erl index 40a8b9c..096be02 100644 --- a/test/examples_SUITE.erl +++ b/test/examples_SUITE.erl @@ -232,3 +232,20 @@ do_file_server(Transport, Protocol, Config) -> {200, _, _} = do_get(Transport, Protocol, "/test.txt", Config), {200, _, _} = do_get(Transport, Protocol, "/video.html", Config), ok. + +%% Markdown middleware. + +markdown_middleware(Config) -> + doc("Markdown middleware example."), + try + do_compile_and_start(markdown_middleware), + do_markdown_middleware(tcp, http, Config), + do_markdown_middleware(tcp, http2, Config) + after + do_stop(markdown_middleware) + end. + +do_markdown_middleware(Transport, Protocol, Config) -> + {200, Headers, <<"<h1>", _/bits >>} = do_get(Transport, Protocol, "/video.html", Config), + {_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers), + ok. |