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:
@@ -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);
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user