From aeb8c1d4aa11ced91d4228541cd340530c8452f5 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Wed, 15 May 2024 21:14:56 -0300 Subject: write: live-dev-server: always send content-length from web routes --- src/write/build-modes/live-dev-server.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js index 91ed4ee3..cb878337 100644 --- a/src/write/build-modes/live-dev-server.js +++ b/src/write/build-modes/live-dev-server.js @@ -302,10 +302,10 @@ export async function go({ try { const {size} = await stat(filePath); const buffer = await readFile(filePath) - response.writeHead(200, contentType ? { - 'Content-Type': contentType, + response.writeHead(200, { + ...contentType ? {'Content-Type': contentType} : {}, 'Content-Length': size, - } : {}); + }); response.end(buffer); if (loudResponses) console.log(`${requestHead} [200] ${pathname}`); } catch (error) { -- cgit 1.3.0-6-gf8a5