Make sure a retention policy is a state event (#8527)

* Make sure a retention policy is a state event

* Changelog
This commit is contained in:
Brendan Abolivier 2020-10-14 12:00:52 +01:00 committed by GitHub
parent ec606ea9e3
commit 3ee97a2748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -83,6 +83,9 @@ class EventValidator:
Args:
event (FrozenEvent): The event to validate.
"""
if not event.is_state():
raise SynapseError(code=400, msg="must be a state event")
min_lifetime = event.content.get("min_lifetime")
max_lifetime = event.content.get("max_lifetime")