From c2be0f20736bf3867b044e2f2bf6eb4fb862daf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 5 Oct 2011 17:55:25 +0200 Subject: Remove the 'HEAD' chunked_reply/3 clause From the RFC: The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. The metainformation contained in the HTTP headers in response to a HEAD request SHOULD be identical to the information sent in response to a GET request. --- 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 dc226a6..0a6bddf 100644 --- a/src/cowboy_http_protocol.erl +++ b/src/cowboy_http_protocol.erl @@ -284,6 +284,8 @@ ensure_response(Req=#http_req{resp_state=waiting}) -> _ = cowboy_http_req:reply(204, [], [], Req), ok; %% Close the chunked reply. +ensure_response(#http_req{method='HEAD', 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