aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-03-19 14:40:39 +0100
committerLoïc Hoguin <[email protected]>2011-03-19 14:40:39 +0100
commit7ef67d08fe05f6510b04b3cbc098ac0e8694e87c (patch)
treeecb8e77c10105555c5e8dcd758488a82ade3644a /src/cowboy_http_protocol.erl
parentc9eb3ce5fc8749bae1dd2f828340145e73063c4b (diff)
downloadcowboy-7ef67d08fe05f6510b04b3cbc098ac0e8694e87c.tar.gz
cowboy-7ef67d08fe05f6510b04b3cbc098ac0e8694e87c.tar.bz2
cowboy-7ef67d08fe05f6510b04b3cbc098ac0e8694e87c.zip
Reply with error 400 on all bad Request-Lines received.
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl4
1 files changed, 3 insertions, 1 deletions
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...