diff options
author | Loïc Hoguin <[email protected]> | 2014-07-12 12:09:43 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2014-07-12 12:09:43 +0200 |
commit | 97a3108576c6a9d64c03e1455654dba88367992a (patch) | |
tree | c9701a8ba567e777509e0fd3508ed6f0bc6b5ea0 /src/cowboy_protocol.erl | |
parent | 20f598f3736cdaab8fd0e9de09f16d18d1dc97f8 (diff) | |
download | cowboy-97a3108576c6a9d64c03e1455654dba88367992a.tar.gz cowboy-97a3108576c6a9d64c03e1455654dba88367992a.tar.bz2 cowboy-97a3108576c6a9d64c03e1455654dba88367992a.zip |
Reply with 400 on header parsing crash
This is a first step to improve the HTTP status codes returned
by Cowboy on crashes. We will tweak it over time.
Also fixes a small bug where two replies may have been sent
when using loop handlers under rare conditions.
Diffstat (limited to 'src/cowboy_protocol.erl')
-rw-r--r-- | src/cowboy_protocol.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl index 3ac967e..84c4401 100644 --- a/src/cowboy_protocol.erl +++ b/src/cowboy_protocol.erl @@ -494,7 +494,7 @@ error_terminate(Status, State=#state{socket=Socket, transport=Transport, -spec error_terminate(cowboy:http_status(), cowboy_req:req(), #state{}) -> ok. error_terminate(Status, Req, State) -> - cowboy_req:maybe_reply(Status, Req), + _ = cowboy_req:reply(Status, Req), terminate(State). -spec terminate(#state{}) -> ok. |