From 12b5e31e49269323c060e75f3140c1b33c61d87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Mart=C3=ADnez=20Portela?= Date: Tue, 19 Sep 2023 23:40:12 +0200 Subject: [PATCH] Handle root index autoserving. --- scripts/autoserve.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/autoserve.py b/scripts/autoserve.py index deb2e0c..ed1fb51 100644 --- a/scripts/autoserve.py +++ b/scripts/autoserve.py @@ -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: