forked from svrjs/svrjs
Partially revert commit 193cede707
This commit is contained in:
parent
8fef063375
commit
8050fc766e
1 changed files with 6 additions and 8 deletions
14
svr.js
14
svr.js
|
@ -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 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
|
var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer
|
||||||
|
|
||||||
function responseEnd(d) {
|
function responseEnd(body) {
|
||||||
res.write(head);
|
//If body is Buffer, then it is converted to String anyway.
|
||||||
res.write(d);
|
res.write(head + body + foot);
|
||||||
res.write(foot);
|
|
||||||
res.end();
|
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 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
|
var foot = fs.existsSync("./.foot") ? fs.readFileSync("./.foot").toString() : (fs.existsSync("./foot.html") ? fs.readFileSync("./foot.html").toString() : ""); // footer
|
||||||
|
|
||||||
function responseEnd(d) {
|
function responseEnd(body) {
|
||||||
res.write(head);
|
//If body is Buffer, then it is converted to String anyway.
|
||||||
res.write(d);
|
res.write(head + body + foot);
|
||||||
res.write(foot);
|
|
||||||
res.end();
|
res.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue