0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 04:10:24 +00:00

Improve the set_resp_headers_list test

This commit is contained in:
Loïc Hoguin 2025-02-11 14:12:04 +01:00
parent e8a1868033
commit 71b4147363
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 4 additions and 1 deletions

View file

@ -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) ->

View file

@ -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)),