private static void validateContentType(AggregatedHttpResponse response, MediaType expectedType) {
        final MediaType contentType = response.contentType();
        if (contentType == null) {
            // if omitted, assume that the type matches the expected
            return;
        }
        final String mediaType = contentType.nameWithoutParameters();
        if (!mediaType.equalsIgnoreCase(expectedType.nameWithoutParameters())) {
            throw new UnsupportedMediaTypeException(mediaType,
                                                    response.status().toString(), response.contentUtf8());
        }
    }
Validates the content type of the response.
oauth2/src/main/java/com/linecorp/armeria/internal/common/auth/oauth2/AbstractOAuth2ResponseHandler.java