mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 06:10:21 +00:00
Return a 404 if an account data type is empty
This commit is contained in:
parent
5c7d2e05e8
commit
47fe40b7ca
1 changed files with 10 additions and 0 deletions
|
@ -83,6 +83,11 @@ class AccountDataServlet(RestServlet):
|
|||
if event is None:
|
||||
raise NotFoundError("Account data not found")
|
||||
|
||||
# If experimental support for MSC3391 is enabled, then this endpoint should
|
||||
# return a 404 if the content for an account data type is an empty dict.
|
||||
if self._hs.config.experimental.msc3391_enabled and event == {}:
|
||||
raise NotFoundError("Account data not found")
|
||||
|
||||
return 200, event
|
||||
|
||||
|
||||
|
@ -209,6 +214,11 @@ class RoomAccountDataServlet(RestServlet):
|
|||
if event is None:
|
||||
raise NotFoundError("Room account data not found")
|
||||
|
||||
# If experimental support for MSC3391 is enabled, then this endpoint should
|
||||
# return a 404 if the content for an account data type is an empty dict.
|
||||
if self._hs.config.experimental.msc3391_enabled and event == {}:
|
||||
raise NotFoundError("Room account data not found")
|
||||
|
||||
return 200, event
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue