mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
matrixsynapse: Use yaml.safe_load
yaml.load() now requires a Loader= argument. yaml.safe_load() passes SafeLoader to yaml.load(). Fixes: #2315. Tests: - Matrix functional tests passed in testing container. - Matrix functional tests passed in stable container. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b49afbc4ff
commit
982fec5a60
@ -49,7 +49,7 @@ def post_install():
|
||||
|
||||
# start with listener config from original homeserver.yaml
|
||||
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
||||
orig_config = yaml.load(orig_conf_file)
|
||||
orig_config = yaml.safe_load(orig_conf_file)
|
||||
|
||||
listeners = orig_config['listeners']
|
||||
for listener in listeners:
|
||||
@ -77,11 +77,11 @@ def public_registration(command: str) -> Optional[bool]:
|
||||
|
||||
try:
|
||||
with open(REGISTRATION_CONF_PATH, encoding='utf-8') as reg_conf_file:
|
||||
config = yaml.load(reg_conf_file)
|
||||
config = yaml.safe_load(reg_conf_file)
|
||||
except FileNotFoundError:
|
||||
# Check if its set in original conffile.
|
||||
with open(ORIG_CONF_PATH, encoding='utf-8') as orig_conf_file:
|
||||
orig_config = yaml.load(orig_conf_file)
|
||||
orig_config = yaml.safe_load(orig_conf_file)
|
||||
config = {
|
||||
'enable_registration':
|
||||
orig_config.get('enable_registration', False)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user