From 92672b49aff04fb129bdf488448c074eeccfdb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 20 Nov 2017 15:46:23 +0100 Subject: Queue HTTP/2 trailers when there's still data in the buffer --- test/handlers/resp_h.erl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/handlers/resp_h.erl') diff --git a/test/handlers/resp_h.erl b/test/handlers/resp_h.erl index 9dae612..ba46213 100644 --- a/test/handlers/resp_h.erl +++ b/test/handlers/resp_h.erl @@ -212,6 +212,15 @@ do(<<"stream_body">>, Req0, Opts) -> end; do(<<"stream_trailers">>, Req0, Opts) -> case cowboy_req:binding(arg, Req0) of + <<"large">> -> + Req = cowboy_req:stream_reply(200, #{ + <<"trailer">> => <<"grpc-status">> + }, Req0), + cowboy_req:stream_body(<<0:800000>>, nofin, Req), + cowboy_req:stream_trailers(#{ + <<"grpc-status">> => <<"0">> + }, Req), + {ok, Req, Opts}; _ -> Req = cowboy_req:stream_reply(200, #{ <<"trailer">> => <<"grpc-status">> -- cgit v1.2.3