/ms -> /mc.html x /mc -> /mc/

This commit is contained in:
2025-12-09 00:25:19 +01:00
parent 3d95d19da5
commit f7aedb5fc7

View File

@@ -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"):