aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http2.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-16 11:00:25 +0200
committerLoïc Hoguin <[email protected]>2018-05-16 11:00:25 +0200
commitae6c787062e4cf834f6c71674fc6aebdb0b23ffa (patch)
tree337afec058e5c03add00651d48afed71d7e7b040 /src/cowboy_http2.erl
parent204fa12df877c3657e0a6e3322d1453f83d09202 (diff)
downloadcowboy-ae6c787062e4cf834f6c71674fc6aebdb0b23ffa.tar.gz
cowboy-ae6c787062e4cf834f6c71674fc6aebdb0b23ffa.tar.bz2
cowboy-ae6c787062e4cf834f6c71674fc6aebdb0b23ffa.zip
Honor the SETTINGS_ENABLE_PUSH from clients
This fixes curl when fetching resources that use push.
Diffstat (limited to 'src/cowboy_http2.erl')
-rw-r--r--src/cowboy_http2.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cowboy_http2.erl b/src/cowboy_http2.erl
index d40046e..8a235af 100644
--- a/src/cowboy_http2.erl
+++ b/src/cowboy_http2.erl
@@ -706,6 +706,10 @@ commands(State0, Stream0=#stream{local=nofin, te=TE0}, [{trailers, Trailers}|Tai
% [{sendfile, IsFin, Offset, Bytes, Path}|Tail]) ->
% {State, Stream} = send_data(State0, Stream0, IsFin, {sendfile, Offset, Bytes, Path}),
% commands(State, Stream, Tail);
+%% Push promises are not sent to clients who disabled them.
+commands(State=#state{remote_settings=#{enable_push := false}}, Stream,
+ [{push, _, _, _, _, _, _, _}|Tail]) ->
+ commands(State, Stream, Tail);
%% Send a push promise.
%%
%% @todo We need to keep track of what promises we made so that we don't