Skip to content

Commit 488ce5c

Browse files
committed
Use the current proxy as fallback when failing to fetch a new one
Prevents accidentally resetting the proxy!
1 parent 4ebc1a3 commit 488ce5c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

mautrix/util/proxy.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,10 @@ def get_proxy_url_from_api(self, reason: str | None = None) -> str | None:
5151
response = json.loads(f.read().decode())
5252
except Exception:
5353
self.log.exception("Failed to retrieve proxy from API")
54+
return self.current_proxy_url
5455
else:
5556
return response["proxy_url"]
5657

57-
return None
58-
5958
def update_proxy_url(self, reason: str | None = None) -> bool:
6059
old_proxy = self.current_proxy_url
6160
new_proxy = None

0 commit comments

Comments
 (0)