aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/resp_h.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-18 18:03:56 +0200
committerLoïc Hoguin <[email protected]>2018-05-18 18:38:26 +0200
commit5229d790fb720ea340171e4b290cffdce9c68197 (patch)
tree4a9991defeddbd272bed5d8e6f90c3f71b45cd3f /test/handlers/resp_h.erl
parent763eef4e46dd8ffb5bb10ddccb1eb761971d8382 (diff)
downloadcowboy-5229d790fb720ea340171e4b290cffdce9c68197.tar.gz
cowboy-5229d790fb720ea340171e4b290cffdce9c68197.tar.bz2
cowboy-5229d790fb720ea340171e4b290cffdce9c68197.zip
Don't send transfer-encoding when streaming 204 responses
Diffstat (limited to 'test/handlers/resp_h.erl')
-rw-r--r--test/handlers/resp_h.erl21
1 files changed, 14 insertions, 7 deletions
diff --git a/test/handlers/resp_h.erl b/test/handlers/resp_h.erl
index 487a724..68b5fe0 100644
--- a/test/handlers/resp_h.erl
+++ b/test/handlers/resp_h.erl
@@ -169,17 +169,24 @@ do(<<"reply4">>, Req0, Opts) ->
end,
{ok, Req, Opts};
do(<<"stream_reply2">>, Req0, Opts) ->
- Req = case cowboy_req:binding(arg, Req0) of
+ case cowboy_req:binding(arg, Req0) of
<<"binary">> ->
- cowboy_req:stream_reply(<<"200 GOOD">>, Req0);
+ Req = cowboy_req:stream_reply(<<"200 GOOD">>, Req0),
+ stream_body(Req),
+ {ok, Req, Opts};
<<"error">> ->
ct_helper:ignore(cowboy_req, stream_reply, 3),
- cowboy_req:stream_reply(ok, Req0);
+ Req = cowboy_req:stream_reply(ok, Req0),
+ stream_body(Req),
+ {ok, Req, Opts};
+ <<"204">> ->
+ Req = cowboy_req:stream_reply(204, Req0),
+ {ok, Req, Opts};
Status ->
- cowboy_req:stream_reply(binary_to_integer(Status), Req0)
- end,
- stream_body(Req),
- {ok, Req, Opts};
+ Req = cowboy_req:stream_reply(binary_to_integer(Status), Req0),
+ stream_body(Req),
+ {ok, Req, Opts}
+ end;
do(<<"stream_reply3">>, Req0, Opts) ->
Req = case cowboy_req:binding(arg, Req0) of
<<"error">> ->