Implement HEAD method properly
We currently return 400 Bad Request for all HEAD requests. To quote https://www.rfc-editor.org/rfc/rfc7231.html#section-4.3.2:
The HEAD method is identical to GET except that the server MUST NOT send a message body in the response (i.e., the response terminates at the end of the header section). The server SHOULD send the same header fields in response to a HEAD request as it would have sent if the request had been a GET, except that the payload header fields (Section 3.3) MAY be omitted.