forked from zaclys/searxng
[fix] autocompleter error handling
This commit is contained in:
parent
39c3f5658e
commit
aff33ea896
|
@ -343,14 +343,14 @@ def autocompleter():
|
||||||
|
|
||||||
# check if search query is set
|
# check if search query is set
|
||||||
if not query.getSearchQuery():
|
if not query.getSearchQuery():
|
||||||
return
|
return '', 400
|
||||||
|
|
||||||
# run autocompleter
|
# run autocompleter
|
||||||
completer = autocomplete_backends.get(request.cookies.get('autocomplete'))
|
completer = autocomplete_backends.get(request.cookies.get('autocomplete'))
|
||||||
|
|
||||||
# check if valid autocompleter is selected
|
# check if valid autocompleter is selected
|
||||||
if not completer:
|
if not completer:
|
||||||
return
|
return '', 400
|
||||||
|
|
||||||
# run autocompletion
|
# run autocompletion
|
||||||
raw_results = completer(query.getSearchQuery())
|
raw_results = completer(query.getSearchQuery())
|
||||||
|
|
Loading…
Reference in New Issue