From b7ff54b2eca56bd7981136133719234dc4392bac Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Mon, 15 Jun 2026 00:42:12 +0200 Subject: [PATCH] fix: file viewer opens audio/svg/binary like the attachments viewer The File Browser preview and Attachments preview share openFilePreview(), but the workspace branch (via /file-content) misclassified several types the attachments viewer handled fine: - SVG was reported as type:image, but file-raw serves SVG as octet-stream + attachment (XSS hardening), so the broke. Now fetched and rendered via a same-origin image/svg+xml blob (safe; never runs SVG scripts). file-raw's SVG hardening is unchanged. - Audio (mp3/wav/ogg/m4a/aac/flac/opus) was type:binary -> "Cannot preview". Now classified as audio and rendered with