From 36a6823e50e36c201df6c7a88a4c77cdaac7f2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 13 Mar 2012 03:00:05 +0100 Subject: Do not send chunked Transfer-Encoding replies for HTTP/1.0 Fixes compatibility issue #140 reported by @majek. --- src/cowboy_http_protocol.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cowboy_http_protocol.erl') diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl index 71518fa..2d58315 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -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">>), -- cgit v1.2.3