node-http-server
/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(); |