mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
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.
This commit is contained in:
parent
aab1587a4b
commit
0201f7f2b2
2 changed files with 25 additions and 4 deletions
|
@ -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().
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue