1
0
Fork 0
forked from svrjs/svrjs

Partially revert commit 193cede707

This commit is contained in:
Dorian Niemiec 2023-09-11 23:21:14 +02:00
parent 8fef063375
commit 8050fc766e

14
svr.js
View file

@ -2329,10 +2329,9 @@ if (!cluster.isPrimary) {
var head = fs.existsSync("./.head") ? fs.readFileSync("./.head").toString() : (fs.existsSync("./head.html") ? fs.readFileSync("./head.html").toString() : ""); // header
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);
res.write(d);
res.write(foot);
function responseEnd(body) {
//If body is Buffer, then it is converted to String anyway.
res.write(head + body + foot);
res.end();
}
@ -2961,10 +2960,9 @@ if (!cluster.isPrimary) {
var head = fs.existsSync("./.head") ? fs.readFileSync("./.head").toString() : (fs.existsSync("./head.html") ? fs.readFileSync("./head.html").toString() : ""); // header
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);
res.write(d);
res.write(foot);
function responseEnd(body) {
//If body is Buffer, then it is converted to String anyway.
res.write(head + body + foot);
res.end();
}