summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-11-14 13:23:03 +0100
committerGitHub <noreply@github.com>2020-11-14 13:23:03 +0100
commitebed1461bc4b635b6dde5d99e53dada6711a6d7a (patch)
treeb86de713b397146fb4929523a1588ccd96f43caa /searx/webapp.py
parent20c95712ead0e538ecc7fa17735c5acc3015840d (diff)
parentb3a3ccf2dbf93b26c506904f53d03e5f11398aab (diff)
downloadsearxng-ebed1461bc4b635b6dde5d99e53dada6711a6d7a.tar.gz
searxng-ebed1461bc4b635b6dde5d99e53dada6711a6d7a.zip
Merge pull request #2300 from dalf/fix-webapp-index
[fix] fix of / and /search
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-xsearx/webapp.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index d68ae349a..9aa80906a 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -547,10 +547,12 @@ def index():
# redirect to search if there's a query in the request
if request.form.get('q'):
- return redirect(url_for('search'), 308)
+ query = ('?' + request.query_string.decode()) if request.query_string else ''
+ return redirect(url_for('search') + query, 308)
return render(
'index.html',
+ selected_categories=get_selected_categories(request.preferences, request.form),
)
@@ -566,8 +568,8 @@ def search():
if output_format not in ['html', 'csv', 'json', 'rss']:
output_format = 'html'
- # check if there is query
- if request.form.get('q') is None:
+ # check if there is query (not None and not an empty string)
+ if not request.form.get('q'):
if output_format == 'html':
return render(
'index.html',