summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMia Herkt <mia@0x0.st>2022-12-01 01:26:32 +0100
committerMia Herkt <mia@0x0.st>2022-12-01 01:26:32 +0100
commited84d3752c56f06e73876af0ab162999562a9d61 (patch)
tree1b02aa1a7b7a385bee706f9d082477098e4de93f
parent7661216bc00e072aec72a0047c867fbf90dbf9bf (diff)
Fix 500 on invalid paths
-rwxr-xr-xfhost.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/fhost.py b/fhost.py
index 70e1109..8770010 100755
--- a/fhost.py
+++ b/fhost.py
@@ -408,6 +408,10 @@ def get(path):
path = Path(path.split("/", 1)[0])
sufs = "".join(path.suffixes[-2:])
name = path.name[:-len(sufs) or None]
+
+ if "." in name:
+ abort(404)
+
id = su.debase(name)
if sufs: