# HG changeset patch # User Ludovic Chabant # Date 1464844289 25200 # Node ID dfd9f5ee46221898aecdb58f00f33fa1a039394b # Parent dafb7d76c2ba988314c2f9a05c31cdfbcbab0853 serve: Fix some problems with trailing slashes. diff -r dafb7d76c2ba -r dfd9f5ee4622 piecrust/serving/util.py --- a/piecrust/serving/util.py Wed Jun 01 22:11:05 2016 -0700 +++ b/piecrust/serving/util.py Wed Jun 01 22:11:29 2016 -0700 @@ -48,6 +48,10 @@ def get_requested_page(app, req_path): + # Remove the trailing slash to simplify how we parse URLs. + if req_path != '/': + req_path = req_path.rstrip('/') + # Try to find what matches the requested URL. routes = find_routes(app.routes, req_path)