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:
parent
6c765101b1
commit
9969684035
1 changed files with 4 additions and 1 deletions
|
@ -855,13 +855,16 @@ stream_trailers(Config) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
stream_trailers_no_te(Config) ->
|
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),
|
ConnPid = gun_open(Config),
|
||||||
Ref = gun:get(ConnPid, "/resp/stream_trailers", [
|
Ref = gun:get(ConnPid, "/resp/stream_trailers", [
|
||||||
{<<"accept-encoding">>, <<"gzip">>}
|
{<<"accept-encoding">>, <<"gzip">>}
|
||||||
]),
|
]),
|
||||||
{response, nofin, 200, RespHeaders} = gun:await(ConnPid, Ref),
|
{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),
|
{ok, RespBody} = gun:await_body(ConnPid, Ref),
|
||||||
|
<<"Hello world!">> = do_decode(RespHeaders, RespBody),
|
||||||
gun:close(ConnPid).
|
gun:close(ConnPid).
|
||||||
|
|
||||||
do_trailers(Path, Config) ->
|
do_trailers(Path, Config) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue