fix: drop jpg/jpeg support from icon system (svg + png only)

Icons.display path only handles svg/png, so jpg-backed icons never
rendered. Remove jpg/jpeg: drop from EXT map and magicOk in ingest.js,
narrow FILE regex in sets.js to (svg|png), update the file input
accept attribute in icon_sets_panel.js, and simplify the content-type
ternary in the icon_sets route (jpeg branch was now unreachable).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
root
2026-06-09 09:12:28 +10:00
parent e309c32d8f
commit 26a9be51d0
4 changed files with 4 additions and 7 deletions

View File

@@ -19,8 +19,7 @@ router.get('/:set/:file', asyncWrap(async (req, res) => {
let buf;
try { buf = await sets.readIcon(req.params.set, req.params.file); }
catch (e) { return res.status(e.message === 'bad_slug' ? 400 : 404).end(); }
const ct = req.params.file.endsWith('.svg') ? 'image/svg+xml'
: req.params.file.endsWith('.png') ? 'image/png' : 'image/jpeg';
const ct = req.params.file.endsWith('.svg') ? 'image/svg+xml' : 'image/png';
res.set('Content-Type', ct).set('Cache-Control', 'public, max-age=86400').send(buf);
}));