mediaType = mediaType.withCharset(defaultCharset);
}
} catch (IllegalArgumentException ignore) {}
}
resp.setContentType(mediaType.type() + "/" + mediaType.subtype());
if (mediaType.charset().isPresent()) {
resp.setCharacterEncoding(mediaType.charset().get().toString());
}