Handle root index autoserving.
This commit is contained in:
parent
7cc2407846
commit
12b5e31e49
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue