changeset 771:673979a5d548

internal: Don't strip the trailing slash when we get the root URL exactly. Before we were treating `/` as a special case, when the special case is *any* root URL -- not just `/`.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 03 Jul 2016 07:53:17 -0700
parents a7726e4862c4
children 3885421c29a3
files piecrust/serving/util.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/serving/util.py	Sat Jul 02 01:30:51 2016 -0700
+++ b/piecrust/serving/util.py	Sun Jul 03 07:53:17 2016 -0700
@@ -49,7 +49,8 @@
 
 def get_requested_page(app, req_path):
     # Remove the trailing slash to simplify how we parse URLs.
-    if req_path != '/':
+    root_url = app.config.get('site/root')
+    if req_path != root_url:
         req_path = req_path.rstrip('/')
 
     # Try to find what matches the requested URL.