No comments on this? Is there anything that can be done differently?
On 10/05/2014 07:33 PM, Nenad Merdanovic wrote:
> Hello,
>
> I accidentally noticed that HAproxy doesn't follow the HTTP standard
> when it comes to HEAD requests. Using an 'errofile' directive will
> return whatever is inside, which often means a HTTP header + a body
> (used to display a nice error page to the end user).
>
> The standard of course forbids this (https://tools.ietf.org/html/rfc7231):
> 4.3.2. HEAD
> 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 easiest fix would be to just ignore errorfile directive on HEAD
> requests, but that might cause problems for people who, like me, abuse
> the errorfile directive to rewrite the return error code (and remove the
> body in the process). If this is the approach we are willing to take,
> the patch is attached.
>
> The other option I see is to add something like 'force-send' to the
> errorfile directive for people who are sure they want to send the
> content on HEAD requests.