forked from MirrorHub/synapse
Fix a bug where Synapse fails to start if a signing key file contains an empty line. (#13738)
This commit is contained in:
parent
d4d3249ded
commit
b7e4bfd005
2 changed files with 13 additions and 1 deletions
1
changelog.d/13738.bugfix
Normal file
1
changelog.d/13738.bugfix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Fix a bug where Synapse fails to start if a signing key file contains an empty line.
|
|
@ -217,7 +217,18 @@ class KeyConfig(Config):
|
||||||
|
|
||||||
signing_keys = self.read_file(signing_key_path, name)
|
signing_keys = self.read_file(signing_key_path, name)
|
||||||
try:
|
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:
|
except Exception as e:
|
||||||
raise ConfigError("Error reading %s: %s" % (name, str(e)))
|
raise ConfigError("Error reading %s: %s" % (name, str(e)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue