0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Do not send chunked Transfer-Encoding replies for HTTP/1.0

Fixes compatibility issue #140 reported by @majek.
This commit is contained in:
Loïc Hoguin 2012-03-13 03:00:05 +01:00
parent e87f51e542
commit 36a6823e50
3 changed files with 31 additions and 8 deletions

View file

@ -402,6 +402,8 @@ ensure_response(Req=#http_req{resp_state=waiting}) ->
%% Close the chunked reply.
ensure_response(#http_req{method='HEAD', resp_state=chunks}) ->
close;
ensure_response(#http_req{version={1, 0}, resp_state=chunks}) ->
close;
ensure_response(#http_req{socket=Socket, transport=Transport,
resp_state=chunks}) ->
Transport:send(Socket, <<"0\r\n\r\n">>),