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

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.
This commit is contained in:
Loïc Hoguin 2011-10-05 17:55:25 +02:00
parent 8eb7af0a0b
commit c2be0f2073
2 changed files with 2 additions and 8 deletions

View file

@ -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">>),