http_server filename regex
This commit is contained in:
parent
d964703e83
commit
a169f37c3a
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue