Handle root index autoserving.

This commit is contained in:
Sergio Martínez Portela 2023-09-19 23:40:12 +02:00
parent 7cc2407846
commit 12b5e31e49

View File

@ -61,6 +61,8 @@ class Server(http.server.SimpleHTTPRequestHandler):
self.end_headers()
path = self.path
if path.strip('/') == '':
path = '/index.html'
if os.path.isdir(path.strip('/')):
path = path.strip('/') + '/index.html'
with open(path.strip('/'), 'rb') as f: