aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-10-03 19:36:58 +0100
committerGravatar Chris Lovering <[email protected]>2024-10-03 21:24:46 +0100
commitd936970e5f6460e4dc28a17b2a332211f5a6d850 (patch)
tree68a81ce830295fb7d110f660f7574cfb48adafb8
parentDrop restriction of only running binaries from /lang (diff)
Add specific error for when the specified binary path does not exist
-rw-r--r--snekbox/api/resources/eval.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py
index d083b19..88bbf96 100644
--- a/snekbox/api/resources/eval.py
+++ b/snekbox/api/resources/eval.py
@@ -128,6 +128,8 @@ class EvalResource:
binary_path = body.get("binary_path")
if binary_path:
binary_path = Path(binary_path)
+ if not binary_path.exists():
+ raise falcon.HTTPBadRequest(title="binary_path does not exist")
if not binary_path.is_file():
raise falcon.HTTPBadRequest(title="binary_path is not a file")