From 0201f7f2b2c8f1ce16fb7404b238e645c96685a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 6 Dec 2011 12:22:36 +0100 Subject: cowboy_http_protocol shouldn't crash if the client sends HTTP responses It was replying back the correct error, but with a crash message in the console. This patch prevents it from crashing. Fixes issue #94 reported by oribrost. --- src/cowboy_http_protocol.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cowboy_http_protocol.erl') diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index b0ee590..83c5513 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -125,7 +125,7 @@ request({http_error, <<"\r\n">>}, error_terminate(400, State); request({http_error, <<"\r\n">>}, State=#state{req_empty_lines=N}) -> parse_request(State#state{req_empty_lines=N + 1}); -request({http_error, _Any}, State) -> +request(_Any, State) -> error_terminate(400, State). -spec parse_header(#http_req{}, #state{}) -> ok | none(). -- cgit v1.2.3