forked from svrjs/svrjs
Optimize responseEnd method
This commit is contained in:
parent
11bc6a32c9
commit
193cede707
2 changed files with 7 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
|||
"port": 80,
|
||||
"pubport": 80,
|
||||
"page404": "404.html",
|
||||
"timestamp": 1694367156151,
|
||||
"timestamp": 1694466099722,
|
||||
"blacklist": [],
|
||||
"nonStandardCodes": [],
|
||||
"enableCompression": true,
|
||||
|
|
8
svr.js
8
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();
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue