diff options
author | Loïc Hoguin <[email protected]> | 2011-12-06 12:22:36 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2011-12-06 12:22:36 +0100 |
commit | 0201f7f2b2c8f1ce16fb7404b238e645c96685a7 (patch) | |
tree | 2edc8478c56342baaaf31a9d74f3ad16b8304a42 /src/cowboy_http_protocol.erl | |
parent | aab1587a4b3d8f0c3d92a2083227527d51109980 (diff) | |
download | cowboy-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.erl | 2 |
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(). |