From d66782753c09a400b0375ff565a17fed849ac36e Mon Sep 17 00:00:00 2001 From: Paul Bakaus Date: Wed, 22 Jul 2026 12:09:24 -0700 Subject: [PATCH] serve-question: correct content-type for svg and gif heroes The local-image map fell through to image/jpeg for anything that was not webp or png, so an svg hero (the fake comp generator's native format) silently failed to render on the decision page. Co-Authored-By: Claude Fable 5 --- skill/scripts/serve-question.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/skill/scripts/serve-question.mjs b/skill/scripts/serve-question.mjs index 42c6aeaec..7291e8b06 100644 --- a/skill/scripts/serve-question.mjs +++ b/skill/scripts/serve-question.mjs @@ -550,7 +550,11 @@ const server = http.createServer((req, res) => { if (imageMatch) { const abs = localImages[Number(imageMatch[1])]; if (!abs) { res.writeHead(404); res.end(); return; } - const type = abs.endsWith('.webp') ? 'image/webp' : abs.endsWith('.png') ? 'image/png' : 'image/jpeg'; + const type = abs.endsWith('.webp') ? 'image/webp' + : abs.endsWith('.png') ? 'image/png' + : abs.endsWith('.svg') ? 'image/svg+xml' + : abs.endsWith('.gif') ? 'image/gif' + : 'image/jpeg'; res.writeHead(200, { 'content-type': type }); fs.createReadStream(abs).pipe(res); return;