Skip to content

Commit

Permalink
Check if Matomo URL is ending with '/' (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
djamg authored Jul 20, 2023
1 parent 0488d09 commit d584217
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/baseframe/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ def init_app(
raise ValueError("App has misconfigured secret keys")
app.session_interface = RotatingKeySecureCookieSessionInterface()

# Default .js and tracking file for Matomo
if app.config.get('MATOMO_URL') and app.config.get('MATOMO_ID'):
# Default .js and tracking file for Matomo
app.config.setdefault('MATOMO_JS', 'matomo.js')
app.config.setdefault('MATOMO_FILE', 'matomo.php')
# Check if Matomo URL is ending with '/' or else add it
if not app.config['MATOMO_URL'].endswith('/'):
app.config['MATOMO_URL'] += '/'

statsd.init_app(app)

Expand Down

0 comments on commit d584217

Please sign in to comment.