mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-26 20:22:22 +00:00
Merge pull request #868 from matrix-org/erikj/invalid_id
Make get_domain_from_id throw SynapseError on invalid ID
This commit is contained in:
commit
d12134ce37
@ -22,7 +22,10 @@ Requester = namedtuple("Requester", ["user", "access_token_id", "is_guest"])
|
|||||||
|
|
||||||
|
|
||||||
def get_domain_from_id(string):
|
def get_domain_from_id(string):
|
||||||
return string.split(":", 1)[1]
|
try:
|
||||||
|
return string.split(":", 1)[1]
|
||||||
|
except IndexError:
|
||||||
|
raise SynapseError(400, "Invalid ID: %r", string)
|
||||||
|
|
||||||
|
|
||||||
class DomainSpecificString(
|
class DomainSpecificString(
|
||||||
|
Loading…
Reference in New Issue
Block a user