From 7f23ae5f525220d167edde4b47398e5c3c6084f2 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Sun, 15 Jan 2023 02:36:16 +0900 Subject: [PATCH] Support acct with domain name in /api/v1/accounts/lookup (#412) --- api/views/accounts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/views/accounts.py b/api/views/accounts.py index b77ce09..f53ee50 100644 --- a/api/views/accounts.py +++ b/api/views/accounts.py @@ -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),