mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-25 13:40:25 -04:00
Fix destination_is
errors seen in sentry. (#13041)
* Rename test_fedclient to match its source file * Require at least one destination to be truthy * Explicitly validate user ID in profile endpoint GETs Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
aef398457f
commit
c99b511db9
7 changed files with 59 additions and 8 deletions
|
@ -267,7 +267,6 @@ class DomainSpecificString(metaclass=abc.ABCMeta):
|
|||
)
|
||||
|
||||
domain = parts[1]
|
||||
|
||||
# This code will need changing if we want to support multiple domain
|
||||
# names on one HS
|
||||
return cls(localpart=parts[0], domain=domain)
|
||||
|
@ -279,6 +278,8 @@ class DomainSpecificString(metaclass=abc.ABCMeta):
|
|||
@classmethod
|
||||
def is_valid(cls: Type[DS], s: str) -> bool:
|
||||
"""Parses the input string and attempts to ensure it is valid."""
|
||||
# TODO: this does not reject an empty localpart or an overly-long string.
|
||||
# See https://spec.matrix.org/v1.2/appendices/#identifier-grammar
|
||||
try:
|
||||
obj = cls.from_string(s)
|
||||
# Apply additional validation to the domain. This is only done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue