aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http2_machine.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cow_http2_machine.erl')
-rw-r--r--src/cow_http2_machine.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/cow_http2_machine.erl b/src/cow_http2_machine.erl
index 3b7cd10..a88d9f1 100644
--- a/src/cow_http2_machine.erl
+++ b/src/cow_http2_machine.erl
@@ -830,9 +830,13 @@ settings_frame({settings, Settings}, State0=#http2_machine{
_ -> {ok, State2}
end;
%% We expect to receive a SETTINGS frame as part of the preface.
-settings_frame(_F, State) ->
+settings_frame(_F, State=#http2_machine{mode=server}) ->
{error, {connection_error, protocol_error,
'The preface sequence must be followed by a SETTINGS frame. (RFC7540 3.5)'},
+ State};
+settings_frame(_F, State) ->
+ {error, {connection_error, protocol_error,
+ 'The preface must begin with a SETTINGS frame. (RFC7540 3.5)'},
State}.
%% When SETTINGS_INITIAL_WINDOW_SIZE changes we need to update