From d25c30790cc3afae03838a160f87ca0acd745989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 4 Oct 2011 10:54:30 +0200 Subject: Do not send a 408 response if the Request-Line wasn't fully received The server should not send a response if there wasn't at least the beginning of a request sent (the Request-Line). --- src/cowboy_http_protocol.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index 40dc51c..14cd8d3 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -87,8 +87,7 @@ wait_request(State=#state{socket=Socket, transport=Transport, case Transport:recv(Socket, 0, T) of {ok, Data} -> parse_request(State#state{ buffer= << Buffer/binary, Data/binary >>}); - {error, timeout} -> error_terminate(408, State); - {error, closed} -> terminate(State) + {error, _Reason} -> terminate(State) end. -spec request({http_request, http_method(), http_uri(), -- cgit v1.2.3