http_server filename regex

This commit is contained in:
Max 2021-07-28 20:06:15 -04:00
parent d964703e83
commit a169f37c3a
1 changed files with 1 additions and 1 deletions

View File

@ -98,7 +98,7 @@ def static_file(environ, start_response):
if environ['PATH_INFO'] == '/': if environ['PATH_INFO'] == '/':
filename = 'index.html' filename = 'index.html'
else: else:
filename = re.sub(r'[^a-zA-Z0-9_.\-]', '', environ['PATH_INFO']) filename = re.sub(r'[^a-zA-Z0-9_.\-/]', '', environ['PATH_INFO'])
suf = filename.split('.')[-1] suf = filename.split('.')[-1]
pathname = '../www/www-static' pathname = '../www/www-static'
if suf in img_types: if suf in img_types: