Relax restrictions on non-served files if fServerDebug is set

This commit is contained in:
Jeff Parsons 2014-09-29 16:18:26 -07:00 • committed by jeffpar
commit 34bbd72629

View file

@ -438,6 +438,7 @@ HTMLOut.filter = function(req, res, next)
var sBaseExt = ((i = sBaseName.lastIndexOf('.')) > 0? sBaseName.substr(i+1) : ""); var sBaseExt = ((i = sBaseName.lastIndexOf('.')) > 0? sBaseName.substr(i+1) : "");
var sTrailingChar = req.path.slice(-1); var sTrailingChar = req.path.slice(-1);
if (!fServerDebug) {
if (asExtsNonServed.indexOf(sBaseExt) >= 0 || asFilesNonServed.indexOf(sBaseName) >= 0) { if (asExtsNonServed.indexOf(sBaseExt) >= 0 || asFilesNonServed.indexOf(sBaseName) >= 0) {
/* /*
* Mimic the error code+message that express.static() displays for non-existent files/folders. * Mimic the error code+message that express.static() displays for non-existent files/folders.
@ -445,6 +446,7 @@ HTMLOut.filter = function(req, res, next)
res.status(404).send("Cannot GET " + req.path); res.status(404).send("Cannot GET " + req.path);
return; return;
} }
}
/* /*
* The Safari "blank page" problem continues to plague us. Our first work-around was for directory * The Safari "blank page" problem continues to plague us. Our first work-around was for directory