From d9cad866f2398fb9d30e8c2ff6d053b90a034098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 20 Jun 2016 17:31:31 +0200 Subject: Add initial req suite --- test/handlers/echo_h.erl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/handlers') diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl index 6db43fe..cdb9be4 100644 --- a/test/handlers/echo_h.erl +++ b/test/handlers/echo_h.erl @@ -11,6 +11,9 @@ echo(What, Req, Opts) -> F = binary_to_atom(What, latin1), Value = case cowboy_req:F(Req) of V when is_integer(V) -> integer_to_binary(V); + V when is_atom(V) -> atom_to_binary(V, latin1); + V when is_list(V); is_tuple(V) -> io_lib:format("~p", [V]); V -> V end, - {ok, cowboy_req:reply(200, #{}, Value, Req), Opts}. + cowboy_req:reply(200, #{}, Value, Req), + {ok, Req, Opts}. -- cgit v1.2.3