merge #193: html preview UTF-8 encoding declaration (Qiuner)

This commit is contained in:
HuanLinOTO
2026-08-24 01:34:15 +08:00
2 changed files with 54 additions and 1 deletions
+1 -1
View File
@@ -866,7 +866,7 @@ export function apply(ctx: Context, config?: SidebarConfig): void {
const type = mediaTypeForPath(absolute)
const body = await readFile(absolute)
res.writeHead(200, {
'content-type': type,
'content-type': type === 'text/html' ? 'text/html; charset=utf-8' : type,
'cache-control': 'no-cache',
'x-content-type-options': 'nosniff',
'referrer-policy': 'no-referrer',