Support acct with domain name in /api/v1/accounts/lookup (#412)

This commit is contained in:
TAKAHASHI Shuuji 2023-01-15 02:36:16 +09:00 committed by GitHub
parent 21d565d282
commit 7f23ae5f52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,8 +86,8 @@ def lookup(request: HttpRequest, acct: str):
Quickly lookup a username to see if it is available, skipping WebFinger
resolution.
"""
acct = acct.lstrip("@")
host = request.get_host()
acct = acct.lstrip("@").removesuffix(f"@{host}")
identity = Identity.objects.filter(
Q(domain__service_domain__iexact=host) | Q(domain__domain__iexact=host),