mirror of
https://git.0x0.st/mia/0x0.git
synced 2024-11-09 11:48:59 -05:00
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.
This commit is contained in:
parent
73045dc5e5
commit
3bdbab96c1
1 changed files with 1 additions and 1 deletions
2
fhost.py
2
fhost.py
|
@ -270,7 +270,7 @@ def store_url(url, addr):
|
||||||
|
|
||||||
@app.route("/<path:path>")
|
@app.route("/<path:path>")
|
||||||
def get(path):
|
def get(path):
|
||||||
path = Path(path)
|
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]
|
||||||
id = su.debase(name)
|
id = su.debase(name)
|
||||||
|
|
Loading…
Reference in a new issue