From ac60be14a58caae1ebc04a763e9896658455c352 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Tue, 7 Feb 2023 23:39:04 +0000 Subject: [PATCH] Sure, we can identify SVG files. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4171 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/core.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/core.js b/core/core.js index 60023049..bdd7ea44 100644 --- a/core/core.js +++ b/core/core.js @@ -542,6 +542,9 @@ function sendData(response, data, type, headers) { } else if (startsWithBytes(data, [0x52, 0x49, 0x46, 0x46, null, null, null, null, 0x57, 0x45, 0x42, 0x50])) { response.writeHead(200, Object.assign({"Content-Type": "image/webp", "Content-Length": data.byteLength}, headers || {})); response.end(data); + } else if (startsWithBytes(data, [0x3c, 0x73, 0x76, 0x67])) { + response.writeHead(200, Object.assign({"Content-Type": "image/svg+xml", "Content-Length": data.byteLength}, headers || {})); + response.end(data); } else if (startsWithBytes(data, [null, null, null, null, 0x66, 0x74, 0x79, 0x70, 0x6d, 0x70, 0x34, 0x32])) { response.writeHead(200, Object.assign({"Content-Type": "audio/mpeg", "Content-Length": data.byteLength}, headers || {})); response.end(data);