static ResponseHeaders ensureContentType(ResponseHeaders headers) {
        final MediaType contentType = headers.contentType();
        if (contentType == null) {
            return headers.toBuilder()
                          .contentType(MediaType.JSON_LINES)
                          .build();
        }

        if (contentType.is(MediaType.JSON_LINES)) {
            return headers;
        }

        if (!warnedContentType) {
            logger.warn("Overwriting content-type from '{}' to '{}' for JSON Lines. " +
                        "Do not set a content-type on the HttpHeaders when calling factory methods in '{}', " +
                        "or set '{}' if you want to specify its content-type. " +
                        "Please refer to https://jsonlines.org/ for more information.",
                    contentType, MediaType.JSON_LINES,
                    JsonLines.class.getSimpleName(), MediaType.JSON_LINES);
            warnedContentType = true;
        }
        return headers.toBuilder()
                      .contentType(MediaType.JSON_LINES)
                      .build();
    }
Returns a newly created JSON Lines response from the specified {@code content}.

<p>Note that this method is intentionally hidden from the public API for use only with
{@code ScalaPbResponseConverterFunction} and {@code ProtobufResponseConverterFunction}.
Because the {@code contentConverter} can easily produce a malformed string which violates the
<a href="https://jsonlines.org/">JSON format</a>.

@param headers the HTTP headers supposed to send
@param content the object supposed to send as contents
@param trailers the HTTP trailers
@param contentConverter the function which converts the content object into a UTF-8 JSON string.
core/src/main/java/com/linecorp/armeria/server/streaming/JsonLines.java