private ResponseHeaders buildResponseHeaders(ServiceRequestContext ctx) {
        final ResponseHeadersBuilder builder = ResponseHeaders.builder(defaultStatus);
        if (builder.status().isContentAlwaysEmpty()) {
            return builder.build();
        }

        final MediaType negotiatedResponseMediaType = ctx.negotiatedResponseMediaType();
        if (negotiatedResponseMediaType != null) {
            builder.contentType(negotiatedResponseMediaType);
        }
        return builder.build();
    }
Converts the specified {@code result} to an {@link HttpResponse}.
core/src/main/java/com/linecorp/armeria/internal/server/annotation/DefaultAnnotatedService.java