webserver: Unquote urls containing quoted characters.
- e.g. Caused by filenames containing spaces.
This commit is contained in:
parent
ae7f53a1fc
commit
2e44fa42dc
1 changed files with 4 additions and 2 deletions
|
|
@ -6,8 +6,9 @@ import functools
|
||||||
import gzip
|
import gzip
|
||||||
import http.server
|
import http.server
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import pickle
|
import pickle
|
||||||
|
import sys
|
||||||
|
import urllib.parse
|
||||||
|
|
||||||
import eris.tools as tools
|
import eris.tools as tools
|
||||||
import fill3
|
import fill3
|
||||||
|
|
@ -50,7 +51,8 @@ def make_main_body():
|
||||||
|
|
||||||
@functools.lru_cache(maxsize=100)
|
@functools.lru_cache(maxsize=100)
|
||||||
def make_listing_page(url_path):
|
def make_listing_page(url_path):
|
||||||
path, tool = os.path.split(url_path)
|
unquoted_path = urllib.parse.unquote(url_path)
|
||||||
|
path, tool = os.path.split(unquoted_path)
|
||||||
result = index[(path, tool)]
|
result = index[(path, tool)]
|
||||||
body = fill3.appearance_as_html(result.appearance_min())
|
body = fill3.appearance_as_html(result.appearance_min())
|
||||||
return make_page(body, f"{tool} of {path}")
|
return make_page(body, f"{tool} of {path}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue