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
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 New Issue