Do not send a chunked body for HEAD requests #87

merged 1 commit into from Sep 14, 2013

2 participants


The HTTP 1.1 spec states

The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response

If a Plack app does not set a body or a Content-Length for a response to a HEAD request (which I believe is correct), Starman currently enables chunked encoding and sends the chunked 'footer' in the body of the response. I believe this contradicts the spec (as above) and causes problems with my (nodejs) client. already disables chunked responses for status codes without a body (204 and 304) - this patch does the same for HEAD requests.

The test fails without the patch to the .pm, it has to use the low level IO::Socket::INET so we get the body before the chunked decoding is applied

@miyagawa miyagawa merged commit c27699c into miyagawa:master Sep 14, 2013

1 check passed

Details default The Travis CI build passed
@therigu therigu deleted the therigu:no-chunked-head branch Sep 14, 2013

Ah, I've just realised I committed with the wrong email address. I have updated the branch, would you be willing to pull that instead? I realise that would require a forced update, so if you're not willing I understand.


Yeah i wouldn't do forced update lightly. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment