Skip to content
Snippets Groups Projects
Unverified Commit b7e4bfd0 authored by reivilibre's avatar reivilibre Committed by GitHub
Browse files

Fix a bug where Synapse fails to start if a signing key file contains an empty line. (#13738)

parent d4d3249d
No related branches found
No related tags found
No related merge requests found
Fix a bug where Synapse fails to start if a signing key file contains an empty line.
\ No newline at end of file
......@@ -217,7 +217,18 @@ class KeyConfig(Config):
signing_keys = self.read_file(signing_key_path, name)
try:
return read_signing_keys(signing_keys.splitlines(True))
loaded_signing_keys = read_signing_keys(
[
signing_key_line
for signing_key_line in signing_keys.splitlines(keepends=False)
if signing_key_line.strip()
]
)
if not loaded_signing_keys:
raise ConfigError(f"No signing keys in file {signing_key_path}")
return loaded_signing_keys
except Exception as e:
raise ConfigError("Error reading %s: %s" % (name, str(e)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment