Further search fixing

This commit is contained in:
Andrew Godwin 2022-12-21 21:46:09 +00:00
parent 45de0e09b5
commit f5f74dc150
2 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class SearchService:
return set()
# Try to fetch the user by handle
handle = self.query.lstrip("@").lower()
handle = self.query.lstrip("@")
results: set[Identity] = set()
if "@" in handle:
username, domain = handle.split("@", 1)

View File

@ -535,6 +535,9 @@ class Identity(StatorModel):
try:
data = response.json()
except ValueError:
# Some servers return these with a 200 status code!
if b"not found" in response.content.lower():
return None, None
raise ValueError(
"JSON parse error fetching webfinger",
response.content,