diff options
author | Loïc Hoguin <[email protected]> | 2019-07-24 13:04:56 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-07-24 13:04:56 +0200 |
commit | 8c6adf73d9d3fa1ebb49d4b9bd71caab1815dcb2 (patch) | |
tree | 0646abc1e66631fa340f6e0cb09cea50bc03d2f6 /test/handlers | |
parent | 516933f9dd2722329b3886c495d5242308958fe1 (diff) | |
download | gun-8c6adf73d9d3fa1ebb49d4b9bd71caab1815dcb2.tar.gz gun-8c6adf73d9d3fa1ebb49d4b9bd71caab1815dcb2.tar.bz2 gun-8c6adf73d9d3fa1ebb49d4b9bd71caab1815dcb2.zip |
Add push_promise_start/push_promise_end events
Diffstat (limited to 'test/handlers')
-rw-r--r-- | test/handlers/push_h.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/handlers/push_h.erl b/test/handlers/push_h.erl new file mode 100644 index 0000000..4184227 --- /dev/null +++ b/test/handlers/push_h.erl @@ -0,0 +1,12 @@ +%% Feel free to use, reuse and abuse the code in this file. + +-module(push_h). + +-export([init/2]). + +init(Req, State) -> + cowboy_req:push("/", #{<<"accept">> => <<"text/plain">>}, Req), + cowboy_req:push("/empty", #{<<"accept">> => <<"text/plain">>}, Req), + {ok, cowboy_req:reply(200, #{ + <<"content-type">> => <<"text/plain">> + }, <<"Hello world!">>, Req), State}. |