mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-02-01 00:45:07 -05:00
Make get_domain_from_id throw SynapseError on invalid ID
This commit is contained in:
parent
16a8884233
commit
36e2aade87
@ -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):
|
||||||
|
try:
|
||||||
return string.split(":", 1)[1]
|
return string.split(":", 1)[1]
|
||||||
|
except IndexError:
|
||||||
|
raise SynapseError(400, "Invalid ID: %r", string)
|
||||||
|
|
||||||
|
|
||||||
class DomainSpecificString(
|
class DomainSpecificString(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user