private static void setContentLength(HttpRequest req, ResponseHeadersBuilder headers,
                                         int contentLength) {
        // https://datatracker.ietf.org/doc/html/rfc2616#section-4.4
        // prohibits to send message body for below cases.
        // and in those cases, content should be empty.
        if (req.method() == HttpMethod.HEAD || headers.status().isContentAlwaysEmpty()) {
            return;
        }
        headers.contentLength(contentLength);
    }
Sets the 'content-length' header to the response.
core/src/main/java/com/linecorp/armeria/server/HttpServerHandler.java