diff options
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) { |