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

Honor the SETTINGS_ENABLE_PUSH from clients

This fixes curl when fetching resources that use push.
This commit is contained in:
Loïc Hoguin 2018-05-16 11:00:25 +02:00
parent 204fa12df8
commit ae6c787062
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 33 additions and 15 deletions

View file

@ -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