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,
|
"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
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
|
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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue