1
0
Fork 0
forked from svrjs/svrjs

Optimize responseEnd method

This commit is contained in:
Dorian Niemiec 2023-09-11 23:08:02 +02:00
parent 11bc6a32c9
commit 193cede707
2 changed files with 7 additions and 3 deletions

View file

@ -3,7 +3,7 @@
"port": 80, "port": 80,
"pubport": 80, "pubport": 80,
"page404": "404.html", "page404": "404.html",
"timestamp": 1694367156151, "timestamp": 1694466099722,
"blacklist": [], "blacklist": [],
"nonStandardCodes": [], "nonStandardCodes": [],
"enableCompression": true, "enableCompression": true,

8
svr.js
View file

@ -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 var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer
function responseEnd(d) { function responseEnd(d) {
res.write(head + d + foot); res.write(head);
res.write(d);
res.write(foot);
res.end(); 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 var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer
function responseEnd(d) { function responseEnd(d) {
res.write(head + d + foot); res.write(head);
res.write(d);
res.write(foot);
res.end(); res.end();
} }