node-http-server

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 21  →  ?path2? @ 22
/config.js.dist
@@ -38,7 +38,7 @@
/^.+\.ico$/
],
// Any files matching these regular expressions will never be offered.
refuse: [
reject: [
/^\.bashrc$/
],
// The name of the website.
/src/handler.js
@@ -140,7 +140,10 @@
}
if (stats.isFile()) {
const file = path.parse(requestPath).base;
if (config.site.refuse.some((expression) => expression.test(file)) ||
// If the file matches the reject list or is not in the accept list,
// then there is no file to serve.
if (config.site.reject.some((expression) => expression.test(file)) ||
!config.site.accept.some((expression) => expression.test(file))) {
response.statusCode = 404;
response.end();