From b5e253354811a5f292b5f1136b6875785f2286b1 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 7 Feb 2024 16:55:55 +0100 Subject: [PATCH] Enforce Dev UI charset to UTF-8 Maybe fixes #38650 --- .../devui/runtime/DevUIBuildTimeStaticHandler.java | 8 ++++---- .../java/io/quarkus/devui/runtime/MvnpmHandler.java | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIBuildTimeStaticHandler.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIBuildTimeStaticHandler.java index c66a937cda0eb..64958b3bbfa7a 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIBuildTimeStaticHandler.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/DevUIBuildTimeStaticHandler.java @@ -107,10 +107,10 @@ public static interface FileExtension { } public static interface MimeType { - public static final String HTML = "text/html"; - public static final String JS = "text/javascript"; + public static final String HTML = "text/html; charset=utf-8"; + public static final String JS = "text/javascript; charset=utf-8"; public static final String JSON = "application/json"; - public static final String CSS = "text/css"; - public static final String PLAIN = "text/plain"; + public static final String CSS = "text/css; charset=utf-8"; + public static final String PLAIN = "text/plain; charset=utf-8"; } } diff --git a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/MvnpmHandler.java b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/MvnpmHandler.java index e5647531e44ec..01e1a5f364174 100644 --- a/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/MvnpmHandler.java +++ b/extensions/vertx-http/runtime/src/main/java/io/quarkus/devui/runtime/MvnpmHandler.java @@ -120,10 +120,10 @@ private String getContentType(String filename) { private static final String CONTENT_TYPE_JAVASCRIPT = "application/javascript"; private static final String CONTENT_TYPE_JSON = "application/json"; - private static final String CONTENT_TYPE_HTML = "text/html"; - private static final String CONTENT_TYPE_XHTML = "application/xhtml+xml"; - private static final String CONTENT_TYPE_XML = "application/xml"; - private static final String CONTENT_TYPE_CSS = "text/css"; - private static final String CONTENT_TYPE_TEXT = "text/plain"; + private static final String CONTENT_TYPE_HTML = "text/html; charset=utf-8"; + private static final String CONTENT_TYPE_XHTML = "application/xhtml+xml; charset=utf-8"; + private static final String CONTENT_TYPE_XML = "application/xml; charset=utf-8"; + private static final String CONTENT_TYPE_CSS = "text/css; charset=utf-8"; + private static final String CONTENT_TYPE_TEXT = "text/plain; charset=utf-8"; }