diff options
| author | Tulir Asokan <tulir@maunium.net> | 2021-04-22 19:12:12 +0300 |
|---|---|---|
| committer | Tulir Asokan <tulir@maunium.net> | 2021-04-22 19:12:54 +0300 |
| commit | 57fde6fcad692c94a7686e87501a93826a865678 (patch) | |
| tree | b1dfdc4c9e52d67981ce54a414e7190b681196ca | |
| parent | ba0096275ce966107b9a00f42e9894af74cebb4c (diff) | |
Assume https if homeserver URL doesn't have protocol
| -rw-r--r-- | sticker/lib/matrix.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sticker/lib/matrix.py b/sticker/lib/matrix.py index 6d075bf..cf405d8 100644 --- a/sticker/lib/matrix.py +++ b/sticker/lib/matrix.py @@ -59,6 +59,8 @@ async def load_config(path: str) -> None: homeserver_url = input("Homeserver URL: ") access_token = input("Access token: ") whoami_url = URL(homeserver_url) / "_matrix" / "client" / "r0" / "account" / "whoami" + if whoami_url.scheme not in ("https", "http"): + whoami_url = whoami_url.with_scheme("https") user_id = await whoami(whoami_url, access_token) with open(path, "w") as config_file: json.dump({ |
