diff options
author | 2022-12-04 10:18:07 +0800 | |
---|---|---|
committer | 2022-12-04 10:18:07 +0800 | |
commit | 81e39d24501bc246807ded02c7d3132cbab14b5d (patch) | |
tree | efda1bc7f6b4951639812e39b8bebb77ec8242a8 | |
parent | Add tests for test_eval 200 (diff) |
Update path regex
-rw-r--r-- | snekbox/api/resources/eval.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/snekbox/api/resources/eval.py b/snekbox/api/resources/eval.py index 28b739d..9a53577 100644 --- a/snekbox/api/resources/eval.py +++ b/snekbox/api/resources/eval.py @@ -36,8 +36,8 @@ class EvalResource: "properties": { "path": { "type": "string", - # Disallow single absolute paths, and null bytes - "pattern": r"^[^/\\0].*", + # Disallow starting with / or containing \0 anywhere + "pattern": r"^(?!/)(?!.*\\0).*$", }, "content": {"type": "string"}, }, |