Handle root index autoserving.
This commit is contained in:
parent
7cc2407846
commit
12b5e31e49
@ -61,6 +61,8 @@ class Server(http.server.SimpleHTTPRequestHandler):
|
|||||||
self.end_headers()
|
self.end_headers()
|
||||||
|
|
||||||
path = self.path
|
path = self.path
|
||||||
|
if path.strip('/') == '':
|
||||||
|
path = '/index.html'
|
||||||
if os.path.isdir(path.strip('/')):
|
if os.path.isdir(path.strip('/')):
|
||||||
path = path.strip('/') + '/index.html'
|
path = path.strip('/') + '/index.html'
|
||||||
with open(path.strip('/'), 'rb') as f:
|
with open(path.strip('/'), 'rb') as f:
|
||||||
|
Loading…
Reference in New Issue
Block a user