diff --git a/site/src/routes/repl/local/[file].js b/site/src/routes/repl/local/[...file].js similarity index 67% rename from site/src/routes/repl/local/[file].js rename to site/src/routes/repl/local/[...file].js index 20d9f509cb52..8c85b124b882 100644 --- a/site/src/routes/repl/local/[file].js +++ b/site/src/routes/repl/local/[...file].js @@ -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();