aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2021-04-22 19:12:12 +0300
committerTulir Asokan <tulir@maunium.net>2021-04-22 19:12:54 +0300
commit57fde6fcad692c94a7686e87501a93826a865678 (patch)
treeb1dfdc4c9e52d67981ce54a414e7190b681196ca
parentba0096275ce966107b9a00f42e9894af74cebb4c (diff)
Assume https if homeserver URL doesn't have protocol
-rw-r--r--sticker/lib/matrix.py2
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({
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage