aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-06-20 17:31:31 +0200
committerLoïc Hoguin <[email protected]>2016-06-20 17:31:31 +0200
commitd9cad866f2398fb9d30e8c2ff6d053b90a034098 (patch)
tree035c7e0d8d9bcc51754c6f06310d4171aad69e57 /test/handlers
parent26c75b57b1c1caa9a72a6d54d374b4bf9d71a4de (diff)
downloadcowboy-d9cad866f2398fb9d30e8c2ff6d053b90a034098.tar.gz
cowboy-d9cad866f2398fb9d30e8c2ff6d053b90a034098.tar.bz2
cowboy-d9cad866f2398fb9d30e8c2ff6d053b90a034098.zip
Add initial req suite
Diffstat (limited to 'test/handlers')
-rw-r--r--test/handlers/echo_h.erl5
1 files changed, 4 insertions, 1 deletions
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}.