mirror of
https://github.com/maunium/stickerpicker.git
synced 2024-11-10 05:37:22 +01:00
Assume https if homeserver URL doesn't have protocol
This commit is contained in:
parent
ba0096275c
commit
57fde6fcad
@ -59,6 +59,8 @@ async def load_config(path: str) -> None:
|
|||||||
homeserver_url = input("Homeserver URL: ")
|
homeserver_url = input("Homeserver URL: ")
|
||||||
access_token = input("Access token: ")
|
access_token = input("Access token: ")
|
||||||
whoami_url = URL(homeserver_url) / "_matrix" / "client" / "r0" / "account" / "whoami"
|
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)
|
user_id = await whoami(whoami_url, access_token)
|
||||||
with open(path, "w") as config_file:
|
with open(path, "w") as config_file:
|
||||||
json.dump({
|
json.dump({
|
||||||
|
Loading…
Reference in New Issue
Block a user