Skip to content
Permalink
Browse files Browse the repository at this point in the history
Ensure workspace files are _in_ the workspace DIR
  • Loading branch information
joelgriffith committed Oct 26, 2020
1 parent 6a195ab commit 848b87e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/routes.ts
Expand Up @@ -157,9 +157,12 @@ export const getRoutes = ({
}

const filePath = path.join(workspaceDir, file);

const hasFile = await exists(filePath);

if (!filePath.includes(workspaceDir)) {
return res.sendStatus(404);
}

if (!hasFile) {
return res.sendStatus(404);
}
Expand All @@ -185,6 +188,10 @@ export const getRoutes = ({
const filePath = path.join(workspaceDir, file);
const hasFile = await exists(filePath);

if (!filePath.includes(workspaceDir)) {
return res.sendStatus(404);
}

if (!hasFile) {
return res.sendStatus(404);
}
Expand Down

0 comments on commit 848b87e

Please sign in to comment.