Skip to content

Commit

Permalink
Merge pull request quarkusio#40014 from geoand/static-encoding
Browse files Browse the repository at this point in the history
Introduce encoding config option for static resources
  • Loading branch information
geoand committed Apr 12, 2024
2 parents 95c1c59 + b128a23 commit 047bb5e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.vertx.http.runtime;

import java.nio.charset.Charset;
import java.time.Duration;

import io.quarkus.runtime.annotations.ConfigGroup;
Expand Down Expand Up @@ -50,4 +51,10 @@ public class StaticResourcesConfig {
@ConfigItem(defaultValue = "10000")
public int maxCacheSize;

/**
* Content encoding for text related files
*/
@ConfigItem(defaultValue = "UTF-8")
public Charset contentEncoding;

}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public Consumer<Route> start(Set<String> knownPaths) {
for (Path resourcePath : hotDeploymentResourcePaths) {
String root = resourcePath.toAbsolutePath().toString();
StaticHandler staticHandler = StaticHandler.create(FileSystemAccess.ROOT, root)
.setDefaultContentEncoding("UTF-8")
.setDefaultContentEncoding(config.contentEncoding.name())
.setCachingEnabled(false)
.setIndexPage(config.indexPage)
.setIncludeHidden(config.includeHidden)
Expand Down

0 comments on commit 047bb5e

Please sign in to comment.