« get me outta code hell

image overlay download progress bar - 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:
author(quasar) nebula <qznebula@protonmail.com>2023-03-01 22:59:41 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-03-01 22:59:41 -0400
commit8b9e855c57c8879934f9ccc8fa17f73966465a17 (patch)
tree9b72d98c500fecca903483722a9d8fe242757da2 /src/write
parent0f7e9e5dfb429b14b816370dc1472ee4c2ae82eb (diff)
image overlay download progress bar
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);