Closed therigu closed 11 years ago
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.
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.
Server.pm 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