Skip to content

Commit

Permalink
analytics: use yarl.URL instead of urlunparse
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Oct 9, 2023
1 parent 7d40c5a commit 7fc2ebe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linkedin_matrix/analytics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from urllib.parse import urlunparse
import logging

from yarl import URL
import aiohttp

from mautrix.util import background_task
Expand All @@ -11,7 +11,7 @@

log = logging.getLogger("mau.web.public.analytics")
http: aiohttp.ClientSession | None = None
analytics_url: str | None = None
analytics_url: URL | None = None
analytics_token: str | None = None
analytics_user_id: str | None = None

Expand Down Expand Up @@ -42,7 +42,7 @@ def init(base_url: str | None, token: str | None, user_id: str | None = None):
return
log.info("Initialising segment-compatible analytics")
global analytics_url, analytics_token, analytics_user_id, http
analytics_url = urlunparse(("https", base_url, "/v1/track", "", "", ""))
analytics_url = URL.build(scheme="https", host=base_url, path="/v1/track")
analytics_token = token
analytics_user_id = user_id
http = aiohttp.ClientSession()

0 comments on commit 7fc2ebe

Please sign in to comment.