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:
parent
a1ad482eb4
commit
39baed6c80
7 changed files with 120 additions and 7 deletions
|
@ -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, #{}).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue