From 7ef67d08fe05f6510b04b3cbc098ac0e8694e87c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 19 Mar 2011 14:40:39 +0100 Subject: Reply with error 400 on all bad Request-Lines received. --- src/cowboy_http_protocol.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index ca23aa9..3388f0d 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -69,7 +69,9 @@ request({http_request, Method, {abs_path, AbsPath}, Version}, wait_header(#http_req{socket=Socket, transport=Transport, method=Method, version=Version, peer=Peer, path=Path, raw_qs=Qs}, State); request({http_error, "\r\n"}, State) -> - wait_request(State). + wait_request(State); +request({http_error, _Any}, State) -> + error_terminate(400, State). -spec wait_header(Req::#http_req{}, State::#state{}) -> ok. %% @todo We don't want to wait T at each header... -- cgit v1.2.3