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

Improve trailers test when no te header is sent

This commit is contained in:
Loïc Hoguin 2017-11-20 12:17:44 +01:00
parent 6c765101b1
commit 9969684035
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -855,13 +855,16 @@ stream_trailers(Config) ->
ok.
stream_trailers_no_te(Config) ->
doc("Stream body followed by trailer headers."),
doc("Stream body followed by trailer headers without a te header in the request."),
ConnPid = gun_open(Config),
Ref = gun:get(ConnPid, "/resp/stream_trailers", [
{<<"accept-encoding">>, <<"gzip">>}
]),
{response, nofin, 200, RespHeaders} = gun:await(ConnPid, Ref),
%% @todo Do we want to remove the trailer header automatically?
% false = lists:keyfind(<<"trailer">>, 1, RespHeaders),
{ok, RespBody} = gun:await_body(ConnPid, Ref),
<<"Hello world!">> = do_decode(RespHeaders, RespBody),
gun:close(ConnPid).
do_trailers(Path, Config) ->