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
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue