diff options
Diffstat (limited to 'test/http_SUITE_data/http_req_attr.erl')
-rw-r--r-- | test/http_SUITE_data/http_req_attr.erl | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/http_SUITE_data/http_req_attr.erl b/test/http_SUITE_data/http_req_attr.erl index eb5e70e..2a4a55d 100644 --- a/test/http_SUITE_data/http_req_attr.erl +++ b/test/http_SUITE_data/http_req_attr.erl @@ -5,15 +5,14 @@ -export([init/3, handle/2, terminate/3]). init({_, http}, Req, _) -> - {Attr, Req2} = cowboy_req:qs_val(<<"attr">>, Req), - {ok, Req2, Attr}. + #{attr := Attr} = cowboy_req:match_qs(Req, [attr]), + {ok, Req, Attr}. handle(Req, <<"host_and_port">> = Attr) -> - {Host, Req2} = cowboy_req:host(Req), - {Port, Req3} = cowboy_req:port(Req2), + Host = cowboy_req:host(Req), + Port = cowboy_req:port(Req), Value = [Host, "\n", integer_to_list(Port)], - {ok, Req4} = cowboy_req:reply(200, [], Value, Req3), - {ok, Req4, Attr}. + {ok, cowboy_req:reply(200, [], Value, Req), Attr}. terminate(_, _, _) -> ok. |