Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 9b9ee75

Browse files
committed
Fix startup error when http proxy is defined. (#6421)
Guess I only tested this on python 2 :/ Fixes #6419.
1 parent b98971e commit 9b9ee75

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

changelog.d/6421.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix startup error when http proxy is defined.

synapse/rest/media/v1/preview_url_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ def __init__(self, hs, media_repo, media_storage):
7777
treq_args={"browser_like_redirects": True},
7878
ip_whitelist=hs.config.url_preview_ip_range_whitelist,
7979
ip_blacklist=hs.config.url_preview_ip_range_blacklist,
80-
http_proxy=os.getenv("http_proxy"),
81-
https_proxy=os.getenv("HTTPS_PROXY"),
80+
http_proxy=os.getenvb(b"http_proxy"),
81+
https_proxy=os.getenvb(b"HTTPS_PROXY"),
8282
)
8383
self.media_repo = media_repo
8484
self.primary_base_path = media_repo.primary_base_path

synapse/server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ def build_simple_http_client(self):
318318
def build_proxied_http_client(self):
319319
return SimpleHttpClient(
320320
self,
321-
http_proxy=os.getenv("http_proxy"),
322-
https_proxy=os.getenv("HTTPS_PROXY"),
321+
http_proxy=os.getenvb(b"http_proxy"),
322+
https_proxy=os.getenvb(b"HTTPS_PROXY"),
323323
)
324324

325325
def build_room_creation_handler(self):

0 commit comments

Comments
 (0)