0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

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.
This commit is contained in:
Loïc Hoguin 2017-01-20 16:06:27 +01:00
parent 353dc29d8f
commit 3b91523a3c
No known key found for this signature in database
GPG key ID: 71366FF21851DF03

View file

@ -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),
{[