aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_stream_h.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-01-20 16:06:27 +0100
committerLoïc Hoguin <[email protected]>2017-01-20 16:06:27 +0100
commit3b91523a3c84a882dcc83f0591b919a939cb72c2 (patch)
tree397cba11fc9e4fc53de2a79eeca7fea146c207a0 /src/cowboy_stream_h.erl
parent353dc29d8f7e9aed7a35426f680f39a975a4cbcb (diff)
downloadcowboy-3b91523a3c84a882dcc83f0591b919a939cb72c2.tar.gz
cowboy-3b91523a3c84a882dcc83f0591b919a939cb72c2.tar.bz2
cowboy-3b91523a3c84a882dcc83f0591b919a939cb72c2.zip
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.
Diffstat (limited to 'src/cowboy_stream_h.erl')
-rw-r--r--src/cowboy_stream_h.erl2
1 files changed, 1 insertions, 1 deletions
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),
{[