From 193cede707efff6106405052c622b56cf515db0c Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Mon, 11 Sep 2023 23:08:02 +0200 Subject: [PATCH] Optimize responseEnd method --- config.json | 2 +- svr.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 28be513..ee9c385 100644 --- a/config.json +++ b/config.json @@ -3,7 +3,7 @@ "port": 80, "pubport": 80, "page404": "404.html", - "timestamp": 1694367156151, + "timestamp": 1694466099722, "blacklist": [], "nonStandardCodes": [], "enableCompression": true, diff --git a/svr.js b/svr.js index 676165e..fb7c0d2 100644 --- a/svr.js +++ b/svr.js @@ -2330,7 +2330,9 @@ if (!cluster.isPrimary) { var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer function responseEnd(d) { - res.write(head + d + foot); + res.write(head); + res.write(d); + res.write(foot); res.end(); } @@ -2960,7 +2962,9 @@ if (!cluster.isPrimary) { var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer function responseEnd(d) { - res.write(head + d + foot); + res.write(head); + res.write(d); + res.write(foot); res.end(); }