fix(projects): use fallback icon MIME (#1197)

Co-authored-by: Isaac Sanchez <isanchez-hawkins@arize.com>
This commit is contained in:
Isaac Sanchez-Hawkins
2026-05-12 11:10:39 +03:00
committed by GitHub
co-authored by Isaac Sanchez
parent 75d78b6113
commit 51356b4195
2 changed files with 110 additions and 1 deletions
@@ -204,7 +204,9 @@ export const registerProjectIconRoutes = (app, dependencies) => {
try {
const data = await fsPromises.readFile(iconPath);
const ext = path.extname(iconPath).slice(1).toLowerCase();
const resolvedMime = metadataMime || projectIconExtensionToMime[ext] || 'application/octet-stream';
const resolvedMime = iconPath === preferredPath && metadataMime
? metadataMime
: projectIconExtensionToMime[ext] || 'application/octet-stream';
const contentType = resolvedMime === 'image/svg+xml' ? 'image/svg+xml; charset=utf-8' : resolvedMime;
if (resolvedMime === 'image/svg+xml' && requestedThemeVariant) {