Browse Source

Unknown HTTP/2 frames are ignored

Loïc Hoguin 8 years ago
parent
commit
07cde7c6de
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/cow_http2.erl

+ 5 - 0
src/cow_http2.erl

@@ -251,6 +251,11 @@ parse(<< _:24, 9:8, _:9, 0:31, _/bits >>) ->
 parse(<< Len:24, 9:8, _:5, FlagEndHeaders:1, _:3, StreamID:31, HeaderBlockFragment:Len/binary, Rest/bits >>) ->
 	{ok, {continuation, StreamID, parse_head_fin(FlagEndHeaders), HeaderBlockFragment}, Rest};
 %%
+%% Unknown frames are ignored.
+%%
+parse(<< Len:24, Type:8, _:40, _:Len/binary, Rest/bits >>) when Type > 9 ->
+	{ignore, Rest};
+%%
 %% Incomplete frames.
 %%
 parse(_) ->