« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write
diff options
context:
space:
mode:
Diffstat (limited to 'src/write')
-rw-r--r--src/write/build-modes/live-dev-server.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index dfebda0e..6dfa7d71 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -226,7 +226,11 @@ export async function go({
       }[extname];
 
       try {
-        response.writeHead(200, contentType ? {'Content-Type': contentType} : {});
+        const {size} = await stat(filePath);
+        response.writeHead(200, contentType ? {
+          'Content-Type': contentType,
+          'Content-Length': size,
+        } : {});
         await pipeline(
           createReadStream(filePath),
           response);