diff --git a/src/baseframe/blueprint.py b/src/baseframe/blueprint.py index 57958a2d..bc70c8b3 100644 --- a/src/baseframe/blueprint.py +++ b/src/baseframe/blueprint.py @@ -141,6 +141,9 @@ def init_app( raise ValueError("App has misconfigured secret keys") app.session_interface = RotatingKeySecureCookieSessionInterface() + # Check if Matomo URL is ending with '/' or else add it + if app.config.get('MATOMO_URL') and not app.config['MATOMO_URL'].endswith('/'): + app.config['MATOMO_URL'] += '/' # Default .js and tracking file for Matomo if app.config.get('MATOMO_URL') and app.config.get('MATOMO_ID'): app.config.setdefault('MATOMO_JS', 'matomo.js')