mirror of
https://git.0x0.st/mia/0x0.git
synced 2024-11-22 08:57:11 +01:00
Fix 500 on invalid paths
This commit is contained in:
parent
7661216bc0
commit
ed84d3752c
1 changed files with 4 additions and 0 deletions
4
fhost.py
4
fhost.py
|
@ -408,6 +408,10 @@ def get(path):
|
||||||
path = Path(path.split("/", 1)[0])
|
path = Path(path.split("/", 1)[0])
|
||||||
sufs = "".join(path.suffixes[-2:])
|
sufs = "".join(path.suffixes[-2:])
|
||||||
name = path.name[:-len(sufs) or None]
|
name = path.name[:-len(sufs) or None]
|
||||||
|
|
||||||
|
if "." in name:
|
||||||
|
abort(404)
|
||||||
|
|
||||||
id = su.debase(name)
|
id = su.debase(name)
|
||||||
|
|
||||||
if sufs:
|
if sufs:
|
||||||
|
|
Loading…
Reference in a new issue