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,12 +438,14 @@ 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 (asExtsNonServed.indexOf(sBaseExt) >= 0 || asFilesNonServed.indexOf(sBaseName) >= 0) { if (!fServerDebug) {
/* 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.
res.status(404).send("Cannot GET " + req.path); */
return; res.status(404).send("Cannot GET " + req.path);
return;
}
} }
/* /*