From 3b91523a3c84a882dcc83f0591b919a939cb72c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 20 Jan 2017 16:06:27 +0100 Subject: Fix error responses not including a content-length This would prevent the client from knowing whether the request was received fully without the connection closing first. --- src/cowboy_stream_h.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cowboy_stream_h.erl') diff --git a/src/cowboy_stream_h.erl b/src/cowboy_stream_h.erl index 531a3fc..8278b21 100644 --- a/src/cowboy_stream_h.erl +++ b/src/cowboy_stream_h.erl @@ -75,7 +75,7 @@ info(_StreamID, {'EXIT', Pid, {_Reason, [_, {cow_http_hd, _, _, _}|_]}}, State=# %% @todo Have an option to enable/disable this specific crash report? %%report_crash(Ref, StreamID, Pid, Reason, Stacktrace), %% @todo Headers? Details in body? More stuff in debug only? - {[{error_response, 400, #{}, <<>>}, stop], State}; + {[{error_response, 400, #{<<"content-length">> => <<"0">>}, <<>>}, stop], State}; info(StreamID, Exit = {'EXIT', Pid, {Reason, Stacktrace}}, State=#state{ref=Ref, pid=Pid}) -> report_crash(Ref, StreamID, Pid, Reason, Stacktrace), {[ -- cgit v1.2.3