aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_req.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-11-15 14:58:49 +0100
committerLoïc Hoguin <[email protected]>2017-11-15 14:58:49 +0100
commit39baed6c800fa9e756f7491063ead399a23083f4 (patch)
tree7c54a8b83b5957438e76c3a56996af4e4ca02c18 /src/cowboy_req.erl
parenta1ad482eb442ea2bd54866656b7a7dc453e4bd8e (diff)
downloadcowboy-39baed6c800fa9e756f7491063ead399a23083f4.tar.gz
cowboy-39baed6c800fa9e756f7491063ead399a23083f4.tar.bz2
cowboy-39baed6c800fa9e756f7491063ead399a23083f4.zip
Add preliminary support for trailers in responses
This depends on changes in Cowlib that are only available on master.
Diffstat (limited to 'src/cowboy_req.erl')
-rw-r--r--src/cowboy_req.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 253564d..da3a0a4 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -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, #{}).