0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Reply status 400 if we receive an unexpected value or error for headers

This commit is contained in:
Loïc Hoguin 2011-12-15 20:43:15 +01:00
parent e550ba7cd3
commit f81cb89b54

View file

@ -199,8 +199,8 @@ header(http_eoh, Req=#http_req{version={1, 0}, transport=Transport,
port=Port, buffer=Buffer}, State#state{buffer= <<>>});
header(http_eoh, Req, State=#state{buffer=Buffer}) ->
handler_init(Req#http_req{buffer=Buffer}, State#state{buffer= <<>>});
header({http_error, _Bin}, _Req, State) ->
error_terminate(500, State).
header(_Any, _Req, State) ->
error_terminate(400, State).
-spec dispatch(fun((#http_req{}, #state{}) -> ok),
#http_req{}, #state{}) -> ok | none().