diff --git a/activities/services/search.py b/activities/services/search.py index ddb30c7..621474f 100644 --- a/activities/services/search.py +++ b/activities/services/search.py @@ -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) diff --git a/users/models/identity.py b/users/models/identity.py index 9388b90..ae9b588 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -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,