Fix live script response encoding (#690)

Declare UTF-8 on the generated live and detector JavaScript responses and cover both endpoints with integration assertions.\n\nAI-assisted: prepared with Codex under @pbakaus direction.
This commit is contained in:
Paul Bakaus
2026-09-01 00:00:51 -04:00
committed by GitHub
parent 85d82c0afc
commit 632912b5ae
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -768,7 +768,7 @@ function createRequestHandler({ detectScript, liveScriptParts }) {
}),
});
res.writeHead(200, {
'Content-Type': 'application/javascript',
'Content-Type': 'application/javascript; charset=utf-8',
'Cache-Control': 'no-store, no-cache, must-revalidate, max-age=0',
'Pragma': 'no-cache',
});
@@ -777,7 +777,7 @@ function createRequestHandler({ detectScript, liveScriptParts }) {
}
if (p === '/detect.js' || p === '/') {
if (!detectScript) { res.writeHead(404); res.end('Not available'); return; }
res.writeHead(200, { 'Content-Type': 'application/javascript' });
res.writeHead(200, { 'Content-Type': 'application/javascript; charset=utf-8' });
res.end(detectScript);
return;
}