aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2011-12-06 12:22:36 +0100
committerLoïc Hoguin <[email protected]>2011-12-06 12:22:36 +0100
commit0201f7f2b2c8f1ce16fb7404b238e645c96685a7 (patch)
tree2edc8478c56342baaaf31a9d74f3ad16b8304a42 /src/cowboy_http_protocol.erl
parentaab1587a4b3d8f0c3d92a2083227527d51109980 (diff)
downloadcowboy-0201f7f2b2c8f1ce16fb7404b238e645c96685a7.tar.gz
cowboy-0201f7f2b2c8f1ce16fb7404b238e645c96685a7.tar.bz2
cowboy-0201f7f2b2c8f1ce16fb7404b238e645c96685a7.zip
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.
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl2
1 files changed, 1 insertions, 1 deletions
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().