aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-12-15 20:43:15 +0100
committerLoïc Hoguin <[email protected]>2011-12-15 20:43:15 +0100
commitf81cb89b5408ec10e3ebce9ac3e2a45bdb5a5230 (patch)
treebebc60f4fc175bcf3218103e64af78ca3dc9d836 /src/cowboy_http_protocol.erl
parente550ba7cd3e63d8d6e45336d6cadb00605d548dd (diff)
downloadcowboy-f81cb89b5408ec10e3ebce9ac3e2a45bdb5a5230.tar.gz
cowboy-f81cb89b5408ec10e3ebce9ac3e2a45bdb5a5230.tar.bz2
cowboy-f81cb89b5408ec10e3ebce9ac3e2a45bdb5a5230.zip
Reply status 400 if we receive an unexpected value or error for headers
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index 41ac909..d08c18b 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -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().