From 3bdbab96c10f5ad01cb46c2af3009564b7d27997 Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Tue, 29 Dec 2020 14:39:56 +0100 Subject: [PATCH] Support client-defined names in file URL routing This allows requests like /j4Tf.bin/myfilename.dat to be served without having to rewrite URLs at the frontend server. --- fhost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhost.py b/fhost.py index e829f77..f939245 100755 --- a/fhost.py +++ b/fhost.py @@ -270,7 +270,7 @@ def store_url(url, addr): @app.route("/") def get(path): - path = Path(path) + path = Path(path.split("/", 1)[0]) sufs = "".join(path.suffixes[-2:]) name = path.name[:-len(sufs) or None] id = su.debase(name)