comparison piecrust/serving/util.py @ 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 dfd9f5ee4622
children 4850f8c21b6e
comparison
equal deleted inserted replaced
770:a7726e4862c4 771:673979a5d548
47 return res + gen_res 47 return res + gen_res
48 48
49 49
50 def get_requested_page(app, req_path): 50 def get_requested_page(app, req_path):
51 # Remove the trailing slash to simplify how we parse URLs. 51 # Remove the trailing slash to simplify how we parse URLs.
52 if req_path != '/': 52 root_url = app.config.get('site/root')
53 if req_path != root_url:
53 req_path = req_path.rstrip('/') 54 req_path = req_path.rstrip('/')
54 55
55 # Try to find what matches the requested URL. 56 # Try to find what matches the requested URL.
56 routes = find_routes(app.routes, req_path) 57 routes = find_routes(app.routes, req_path)
57 58