mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 12:36:02 -04:00
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.
This commit is contained in:
parent
dd95eb4cb5
commit
eb79110beb
3 changed files with 36 additions and 40 deletions
|
@ -100,13 +100,13 @@ class ContentRepositoryConfig(Config):
|
|||
"to work"
|
||||
)
|
||||
|
||||
if "url_preview_ip_range_whitelist" in config:
|
||||
self.url_preview_ip_range_whitelist = IPSet(
|
||||
config["url_preview_ip_range_whitelist"]
|
||||
)
|
||||
self.url_preview_ip_range_whitelist = IPSet(
|
||||
config.get("url_preview_ip_range_whitelist", ())
|
||||
)
|
||||
|
||||
if "url_preview_url_blacklist" in config:
|
||||
self.url_preview_url_blacklist = config["url_preview_url_blacklist"]
|
||||
self.url_preview_url_blacklist = config.get(
|
||||
"url_preview_url_blacklist", ()
|
||||
)
|
||||
|
||||
def default_config(self, **kwargs):
|
||||
media_store = self.default_path("media_store")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue