From 4293e75082e5a730dc63bf898f736e40615bb2d2 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 16 Jun 2022 15:53:13 +0000 Subject: [PATCH] Add some mp4 file magic. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3899 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 b52e40b12..e1d36aaca 100644 --- a/core/core.js +++ b/core/core.js @@ -368,6 +368,9 @@ function sendData(response, data, type, headers) { startsWithBytes(data, [0x47, 0x49, 0x46, 0x38, 0x39, 0x61])) { response.writeHead(200, Object.assign({"Content-Type": "image/gif", "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); } else { response.writeHead(200, Object.assign({"Content-Type": type || "text/javascript; charset=utf-8", "Content-Length": data.byteLength}, headers || {})); response.end(data);