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

Add preliminary support for trailers in responses

This depends on changes in Cowlib that are only available on
master.
This commit is contained in:
Loïc Hoguin 2017-11-15 14:58:49 +01:00
parent a1ad482eb4
commit 39baed6c80
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
7 changed files with 120 additions and 7 deletions

View file

@ -81,6 +81,7 @@
%% @todo stream_body/2 (nofin)
-export([stream_body/3]).
%% @todo stream_event/2,3
-export([stream_trailers/2]).
-export([push/3]).
-export([push/4]).
@ -774,6 +775,11 @@ stream_body(Data, IsFin, #{pid := Pid, streamid := StreamID, has_sent_resp := he
Pid ! {{Pid, StreamID}, {data, IsFin, Data}},
ok.
-spec stream_trailers(cowboy:http_headers(), req()) -> ok.
stream_trailers(Trailers, #{pid := Pid, streamid := StreamID, has_sent_resp := headers}) ->
Pid ! {{Pid, StreamID}, {trailers, Trailers}},
ok.
-spec push(binary(), cowboy:http_headers(), req()) -> ok.
push(Path, Headers, Req) ->
push(Path, Headers, Req, #{}).