node-http-server – Diff between revs 20 and 22

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 20 Rev 22
Line 138... Line 138...
138 index(config, request, response, requestPath, requestURL, callback); 138 index(config, request, response, requestPath, requestURL, callback);
139 return; 139 return;
140 } 140 }
141 if (stats.isFile()) { 141 if (stats.isFile()) {
142 const file = path.parse(requestPath).base; 142 const file = path.parse(requestPath).base;
-   143
-   144 // If the file matches the reject list or is not in the accept list,
-   145 // then there is no file to serve.
143 if (config.site.refuse.some((expression) => expression.test(file)) || 146 if (config.site.reject.some((expression) => expression.test(file)) ||
144 !config.site.accept.some((expression) => expression.test(file))) { 147 !config.site.accept.some((expression) => expression.test(file))) {
145 response.statusCode = 404; 148 response.statusCode = 404;
146 response.end(); 149 response.end();
147 return; 150 return;
148 } 151 }