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

Add HTTP/2 tests with responses with HTTP/1.1 specific headers

This commit is contained in:
Loïc Hoguin 2019-10-03 11:56:39 +02:00
parent 99df823cc3
commit 57badc9082
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 60 additions and 2 deletions

View file

@ -39,6 +39,16 @@ do(<<"set_resp_headers">>, Req0, Opts) ->
<<"content-encoding">> => <<"compress">>
}, Req0),
{ok, cowboy_req:reply(200, #{}, "OK", Req), Opts};
do(<<"set_resp_headers_http11">>, Req0, Opts) ->
Req = cowboy_req:set_resp_headers(#{
<<"connection">> => <<"custom-header, close">>,
<<"custom-header">> => <<"value">>,
<<"keep-alive">> => <<"timeout=5, max=1000">>,
<<"proxy-connection">> => <<"close">>,
<<"transfer-encoding">> => <<"chunked">>,
<<"upgrade">> => <<"HTTP/1.1">>
}, Req0),
{ok, cowboy_req:reply(200, #{}, "OK", Req), Opts};
do(<<"resp_header_defined">>, Req0, Opts) ->
Req1 = cowboy_req:set_resp_header(<<"content-type">>, <<"text/plain">>, Req0),
<<"text/plain">> = cowboy_req:resp_header(<<"content-type">>, Req1),