Skip to content

Commit

Permalink
Improve the set_resp_headers_list test
Browse files Browse the repository at this point in the history
  • Loading branch information
essen committed Feb 11, 2025
1 parent e8a1868 commit 71b4147
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/handlers/resp_h.erl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ do(<<"set_resp_headers">>, Req0, Opts) ->
do(<<"set_resp_headers_list">>, Req0, Opts) ->
Req = cowboy_req:set_resp_headers([
{<<"content-type">>, <<"text/plain">>},
{<<"content-encoding">>, <<"compress">>}
{<<"test-header">>, <<"one">>},
{<<"content-encoding">>, <<"compress">>},
{<<"test-header">>, <<"two">>}
], Req0),
{ok, cowboy_req:reply(200, #{}, "OK", Req), Opts};
do(<<"set_resp_headers_cookie">>, Req0, Opts) ->
Expand Down
1 change: 1 addition & 0 deletions test/req_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ set_resp_headers(Config) ->
{200, Headers2, <<"OK">>} = do_get("/resp/set_resp_headers_list", Config),
true = lists:keymember(<<"content-type">>, 1, Headers2),
true = lists:keymember(<<"content-encoding">>, 1, Headers2),
{_, <<"one, two">>} = lists:keyfind(<<"test-header">>, 1, Headers2),
%% The set-cookie header is special. set_resp_cookie must be used.
{500, _, _} = do_maybe_h3_error3(do_get("/resp/set_resp_headers_cookie", Config)),
{500, _, _} = do_maybe_h3_error3(do_get("/resp/set_resp_headers_list_cookie", Config)),
Expand Down

0 comments on commit 71b4147

Please sign in to comment.