Skip to content

Commit 84794f2

Browse files
committed
Added support for files/directories that have space in their name
1 parent f0a1575 commit 84794f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/httpserver_templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
@server.route("/")
2929
def directory_listing(request: Request):
30-
path = request.query_params.get("path") or ""
30+
path = request.query_params.get("path", "").replace("%20", " ")
3131

3232
# Preventing path traversal by removing all ../ from path
3333
path = re.sub(r"\/(\.\.)\/|\/(\.\.)|(\.\.)\/", "/", path).strip("/")

0 commit comments

Comments
 (0)