From c90893ec688a7cc2fa31b0dee4e4964fd3a8a968 Mon Sep 17 00:00:00 2001 From: Matt Strapp Date: Mon, 14 Feb 2022 16:04:56 -0600 Subject: change some 403s to 400s Signed-off-by: Matt Strapp --- src/routes/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/routes') diff --git a/src/routes/api.ts b/src/routes/api.ts index eb20963..bae30b0 100644 --- a/src/routes/api.ts +++ b/src/routes/api.ts @@ -73,17 +73,17 @@ api.route('/actuate') try { await access(req.body.path); } catch (err) { - return res.status(403).json({ error: 'File is not accessible.' }); + return res.status(403).json({ error: 'File is not accessible or does not exist.' }); } const stats = await stat(req.body.path); // Make sure the file being requested to run is a regular file if (!stats.isFile()) - return res.status(403).json({ error: 'File is not a regular file.' }); + return res.status(400).json({ error: 'File is not a regular file.' }); // Make sure the file being requested to run is not a directory if (stats.isDirectory()) - return res.status(403).json({ error: 'File is a directory.' }); + return res.status(400).json({ error: 'File is a directory.' }); const escaped = quote( [ req.body.path ] ); // Run the code -- cgit v1.2.3