From b1b100ccf4675a84100278baf7087d899224f6a6 Mon Sep 17 00:00:00 2001 From: Lxy Date: Wed, 8 Dec 2021 16:35:08 +0800 Subject: [PATCH] add response content-length --- doric-cli/src/resourceServer.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/doric-cli/src/resourceServer.ts b/doric-cli/src/resourceServer.ts index 0e8726fa..0641ad9d 100644 --- a/doric-cli/src/resourceServer.ts +++ b/doric-cli/src/resourceServer.ts @@ -18,6 +18,7 @@ export async function createResServer() { const resourcePath = path.join(dirPath, `${fileRealName}`); if (fs.existsSync(resourcePath)) { const data = fs.readFileSync(resourcePath); + response.setHeader("content-length", data.length); response.write(data); response.end(); } else {