diff --git a/scripts/autoserve.py b/scripts/autoserve.py index 4c7739e..deb2e0c 100644 --- a/scripts/autoserve.py +++ b/scripts/autoserve.py @@ -60,11 +60,14 @@ class Server(http.server.SimpleHTTPRequestHandler): # send response headers self.end_headers() - with open(self.path.strip('/'), 'rb') as f: + path = self.path + if os.path.isdir(path.strip('/')): + path = path.strip('/') + '/index.html' + with open(path.strip('/'), 'rb') as f: # send the body of the response self.wfile.write(f.read()) - if not self.path.endswith('.html'): + if not path.endswith('.html'): return else: # Append update waiter