diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-02-11 21:13:53 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-02-11 21:15:01 +0000 |
commit | 2129dd1a023d1e221dab8753be3fbd7024963634 (patch) | |
tree | 21dce0b9f23408d6ff5face3b02bc5355defa7ce | |
parent | Move ClientTLSOptionsFactory init out of refresh_certificates (#4611) (diff) | |
download | synapse-2129dd1a023d1e221dab8753be3fbd7024963634.tar.xz |
Fail cleanly if listener config lacks a 'port'
... otherwise we would fail with a mysterious KeyError or something later.
Diffstat (limited to '')
-rw-r--r-- | changelog.d/4616.misc | 1 | ||||
-rw-r--r-- | synapse/config/server.py | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/changelog.d/4616.misc b/changelog.d/4616.misc new file mode 100644 index 0000000000..ee79e208e3 --- /dev/null +++ b/changelog.d/4616.misc @@ -0,0 +1 @@ +Fail cleanly if listener config lacks a 'port' diff --git a/synapse/config/server.py b/synapse/config/server.py index ce0458195c..eed9d7c81e 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -129,6 +129,11 @@ class ServerConfig(Config): self.listeners = config.get("listeners", []) for listener in self.listeners: + if not isinstance(listener.get("port", None), int): + raise ConfigError( + "Listener configuration is lacking a valid 'port' option" + ) + bind_address = listener.pop("bind_address", None) bind_addresses = listener.setdefault("bind_addresses", []) |