Relax restrictions on non-served files if fServerDebug is set
This commit is contained in:
parent
911934f8d2
commit
34bbd72629
1 changed files with 9 additions and 7 deletions
|
|
@ -437,13 +437,15 @@ HTMLOut.filter = function(req, res, next)
|
|||
var sBaseName = path.basename(req.path);
|
||||
var sBaseExt = ((i = sBaseName.lastIndexOf('.')) > 0? sBaseName.substr(i+1) : "");
|
||||
var sTrailingChar = req.path.slice(-1);
|
||||
|
||||
if (asExtsNonServed.indexOf(sBaseExt) >= 0 || asFilesNonServed.indexOf(sBaseName) >= 0) {
|
||||
/*
|
||||
* Mimic the error code+message that express.static() displays for non-existent files/folders.
|
||||
*/
|
||||
res.status(404).send("Cannot GET " + req.path);
|
||||
return;
|
||||
|
||||
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.
|
||||
*/
|
||||
res.status(404).send("Cannot GET " + req.path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue