Skip to content

Commit

Permalink
site: support files in directories in /repl/local/
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed Jun 3, 2019
1 parent f7e6b32 commit daf3295
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createReadStream } from 'fs';

export function get(req, res) {
if (process.env.NODE_ENV !== 'development' || !/^[a-z.]+$/.test(req.params.file)) {
if (process.env.NODE_ENV !== 'development') {
res.writeHead(403);
res.end();
return;
}
createReadStream('../' + req.params.file)
createReadStream('../' + req.params.file.join('/'))
.on('error', () => {
res.writeHead(403);
res.end();
Expand Down

0 comments on commit daf3295

Please sign in to comment.