From f3582779f4c01807ac44de3512ca79a2b959a8f7 Mon Sep 17 00:00:00 2001
From: str4d <str4d@mail.i2p>
Date: Tue, 11 Sep 2012 00:57:15 +0000
Subject: [PATCH] Fall back to index.html if a page directory is requested
 instead of a page file

---
 www.i2p2/i2p2www/__init__.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/www.i2p2/i2p2www/__init__.py b/www.i2p2/i2p2www/__init__.py
index 701682faf..c1644d0a9 100644
--- a/www.i2p2/i2p2www/__init__.py
+++ b/www.i2p2/i2p2www/__init__.py
@@ -117,9 +117,13 @@ def site_show(page='index'):
     name = 'site/%s.html' % page
     page_file = safe_join(TEMPLATE_DIR, name)
 
-    # bah! those damn users all the time!
     if not os.path.exists(page_file):
-        abort(404)
+        # Could be a directory, so try index.html
+        name = 'site/%s/index.html' % page
+        page_file = safe_join(TEMPLATE_DIR, name)
+        if not os.path.exists(page_file):
+            # bah! those damn users all the time!
+            abort(404)
 
     # hah!
     return render_template(name, page=page)
-- 
GitLab