From ed84d3752c56f06e73876af0ab162999562a9d61 Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Thu, 1 Dec 2022 01:26:32 +0100 Subject: [PATCH] Fix 500 on invalid paths --- fhost.py | 4 ++++ 1 file changed, 4 insertions(+) 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: