diff options
Diffstat (limited to 'test/handlers/echo_h.erl')
-rw-r--r-- | test/handlers/echo_h.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl index 18bdbe6..04c3cf5 100644 --- a/test/handlers/echo_h.erl +++ b/test/handlers/echo_h.erl @@ -22,6 +22,10 @@ echo(<<"read_body">>, Req0, Opts) -> cowboy_req:inform(100, Req0), cowboy_req:read_body(Req0); <<"/full", _/bits>> -> read_body(Req0, <<>>); + <<"/length", _/bits>> -> + {_, _, Req1} = read_body(Req0, <<>>), + Length = cowboy_req:body_length(Req1), + {ok, integer_to_binary(Length), Req1}; <<"/opts", _/bits>> -> cowboy_req:read_body(Req0, Opts); _ -> cowboy_req:read_body(Req0) end, |