class

Hwaro::Services::HeadBodyHandler

Inherits HTTP::Handler < Reference < Object

HEAD answered by HTTP::StaticFileHandler carries the whole file: stdlib copies it to the response regardless of the method, and Crystal never suppresses a handler-written body. Like the 404 body (see NotFoundHandler), that desynced keep-alive clients, which read the bytes as the start of the next response. For HEAD this swaps the response output for a sink that drops the body; the Content-Length the static handler already set stays, and closing the sink writes the headers.

Instance methods

call(context)
Source