aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'test/handlers')
-rw-r--r--test/handlers/echo_h.erl7
1 files changed, 5 insertions, 2 deletions
diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl
index 5042ca8..b7a407b 100644
--- a/test/handlers/echo_h.erl
+++ b/test/handlers/echo_h.erl
@@ -55,8 +55,11 @@ echo(<<"match">>, Req, Opts) ->
end,
{ok, cowboy_req:reply(200, #{}, value_to_iodata(Value), Req), Opts};
echo(What, Req, Opts) ->
- F = binary_to_atom(What, latin1),
- Value = cowboy_req:F(Req),
+ Key = binary_to_atom(What, latin1),
+ Value = case cowboy_req:path(Req) of
+ <<"/direct/",_/bits>> -> maps:get(Key, Req);
+ _ -> cowboy_req:Key(Req)
+ end,
{ok, cowboy_req:reply(200, #{}, value_to_iodata(Value), Req), Opts}.
echo_arg(Arg0, Req, Opts) ->