mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-27 12:01:14 +00:00
strip spaces from user search
Strips leading and trailing spaces from user search to prevent errors when doing webfinger lookup. Prior to this, webfinger user queries included everything after the second '@' as part of the hostname. This resulted in failed webfinger requests when there was one or more trailing spaces. Fixes #2205
This commit is contained in:
parent
d58282bc37
commit
22495e40bd
1 changed files with 1 additions and 0 deletions
|
@ -90,6 +90,7 @@ def user_search(request):
|
|||
"""cool kids members only user search"""
|
||||
viewer = request.user
|
||||
query = request.GET.get("q")
|
||||
query = query.strip()
|
||||
data = {"type": "user", "query": query}
|
||||
# logged out viewers can't search users
|
||||
if not viewer.is_authenticated:
|
||||
|
|
Loading…
Reference in a new issue