diff options
author | Mark Haines <mark.haines@matrix.org> | 2016-05-16 13:03:59 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2016-05-16 13:03:59 +0100 |
commit | eb79110beb79c639d75b26f6c5832a8192776a8f (patch) | |
tree | 7f7cff56157068180daef95e1994af8d22f107d7 /synapse/http/client.py | |
parent | Merge branch 'develop' into matthew/preview_url_ip_whitelist (diff) | |
download | synapse-eb79110beb79c639d75b26f6c5832a8192776a8f.tar.xz |
Clean up the blacklist/whitelist handling.
Always set the config key with an empty list, even if a list isn't specified. This means that the codepaths are the same for both the empty list and for a missing key. Since the behaviour is the same for both cases this makes the code somewhat easier to reason about.
Diffstat (limited to 'synapse/http/client.py')
-rw-r--r-- | synapse/http/client.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/synapse/http/client.py b/synapse/http/client.py index a8e2d8e808..c7fa692435 100644 --- a/synapse/http/client.py +++ b/synapse/http/client.py @@ -380,8 +380,7 @@ class CaptchaServerHttpClient(SimpleHttpClient): class SpiderEndpointFactory(object): def __init__(self, hs): self.blacklist = hs.config.url_preview_ip_range_blacklist - if hasattr(hs.config, "url_preview_ip_range_whitelist"): - self.whitelist = hs.config.url_preview_ip_range_whitelist + self.whitelist = hs.config.url_preview_ip_range_whitelist self.policyForHTTPS = hs.get_http_client_context_factory() def endpointForURI(self, uri): |