diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 21:14:56 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-15 21:14:56 -0300 |
commit | aeb8c1d4aa11ced91d4228541cd340530c8452f5 (patch) | |
tree | b8dbaf57342634c39f7c276f5bb27fd533d2aae8 /src/write | |
parent | f50792513c5f8f8b8c48c0064ccb3894b38479b0 (diff) |
write: live-dev-server: always send content-length from web routes
Diffstat (limited to 'src/write')
-rw-r--r-- | src/write/build-modes/live-dev-server.js | 6 |
1 files 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) { |