diff options
author | Loïc Hoguin <[email protected]> | 2013-06-07 18:36:29 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-06-07 18:36:29 +0200 |
commit | be0f7a214cec085860344f2edf9b2d8f2dc1e127 (patch) | |
tree | 6ecde9cb764dd7fb73682d332dad26d5f82089e3 /src | |
parent | 5179b0647b1d6121013585bcd78402096f8dc04a (diff) | |
parent | 157f64b49b23210015d40bc63391060c2aba2b0c (diff) | |
download | cowboy-be0f7a214cec085860344f2edf9b2d8f2dc1e127.tar.gz cowboy-be0f7a214cec085860344f2edf9b2d8f2dc1e127.tar.bz2 cowboy-be0f7a214cec085860344f2edf9b2d8f2dc1e127.zip |
Merge branch 'spdy-zero-length-header-names' of git://github.com/bgentry/cowboy
Diffstat (limited to 'src')
-rw-r--r-- | src/cowboy_spdy.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cowboy_spdy.erl b/src/cowboy_spdy.erl index f778b8e..182e6da 100644 --- a/src/cowboy_spdy.erl +++ b/src/cowboy_spdy.erl @@ -258,6 +258,9 @@ control_frame(State=#state{middlewares=Middlewares, env=Env, loop(State#state{last_streamid=StreamID, children=[#child{streamid=StreamID, pid=Pid, input=IsFin, output=nofin}|Children]}); + {error, badname} -> + rst_stream(State, StreamID, protocol_error), + loop(State#state{last_streamid=StreamID}); {error, special} -> rst_stream(State, StreamID, protocol_error), loop(State#state{last_streamid=StreamID}) @@ -355,6 +358,8 @@ syn_stream_headers(<<>>, 0, Acc, Special=#special_headers{ true -> {ok, lists:reverse(Acc), Special} end; +syn_stream_headers(<< 0:32, _Rest/bits >>, _NbHeaders, _Acc, _Special) -> + {error, badname}; syn_stream_headers(<< NameLen:32, Rest/bits >>, NbHeaders, Acc, Special) -> << Name:NameLen/binary, ValueLen:32, Rest2/bits >> = Rest, << Value:ValueLen/binary, Rest3/bits >> = Rest2, |