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

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

        if (!warnedContentType) {
            logger.warn("Overwriting content-type from '{}' to '{}' for Server-Sent Events. " +
                        "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://www.w3.org/TR/eventsource/ for more information.",
                        contentType, MediaType.EVENT_STREAM,
                        ServerSentEvents.class.getSimpleName(), MediaType.EVENT_STREAM);
            warnedContentType = true;
        }
        return headers.toBuilder()
                      .contentType(MediaType.EVENT_STREAM)
                      .build();
    }
Creates a new Server-Sent Events stream of the specified {@code content}.

@param headers the HTTP headers supposed to send
@param sse the {@link ServerSentEvent} object supposed to send as contents
@param trailers the HTTP trailers
core/src/main/java/com/linecorp/armeria/server/streaming/ServerSentEvents.java