diff options
author | Blake Gentry <[email protected]> | 2013-05-30 11:36:20 -0700 |
---|---|---|
committer | Blake Gentry <[email protected]> | 2013-05-31 11:15:20 -0700 |
commit | 157f64b49b23210015d40bc63391060c2aba2b0c (patch) | |
tree | dc260011d44a324172da7c2c03215562c64c8324 /src | |
parent | 9a2d35c2e800ee73c27b6d6cc324453c5219f715 (diff) | |
download | cowboy-157f64b49b23210015d40bc63391060c2aba2b0c.tar.gz cowboy-157f64b49b23210015d40bc63391060c2aba2b0c.tar.bz2 cowboy-157f64b49b23210015d40bc63391060c2aba2b0c.zip |
zero-length header names MUST issue a stream error
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 ba02706..3fe477b 100644 --- a/src/cowboy_spdy.erl +++ b/src/cowboy_spdy.erl @@ -247,6 +247,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}) @@ -344,6 +347,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, |