From f7aedb5fc763a64a8bc8948c07e90081d4ecad93 Mon Sep 17 00:00:00 2001 From: Krzak Date: Tue, 9 Dec 2025 00:25:19 +0100 Subject: [PATCH] /ms -> /mc.html x /mc -> /mc/ --- server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index 0b364bd..d14590e 100644 --- a/server.py +++ b/server.py @@ -8,7 +8,12 @@ class C(H): def do_GET(self): p = self.path if p.endswith("/"): - p += "index.html" + base_path = p.rstrip("/") + html_file = base_path + ".html" + if os.path.exists(os.path.join(os.getcwd(), html_file.lstrip("/"))): + p = html_file + else: + p += "index.html" elif "." not in p.split("/")[-1]: r = os.path.join(os.getcwd(), p.lstrip("/")) if os.path.exists(r + ".html"):