aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-06-07 18:36:29 +0200
committerLoïc Hoguin <[email protected]>2013-06-07 18:36:29 +0200
commitbe0f7a214cec085860344f2edf9b2d8f2dc1e127 (patch)
tree6ecde9cb764dd7fb73682d332dad26d5f82089e3 /src
parent5179b0647b1d6121013585bcd78402096f8dc04a (diff)
parent157f64b49b23210015d40bc63391060c2aba2b0c (diff)
downloadcowboy-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.erl5
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,