diff options
Diffstat (limited to 'searx/webapp.py')
-rwxr-xr-x | searx/webapp.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 83bbeac06..eb2b19d44 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1282,19 +1282,17 @@ Disallow: /*?*q=* @app.route('/opensearch.xml', methods=['GET']) def opensearch(): - method = 'post' - - if request.preferences.get_value('method') == 'GET': - method = 'get' + method = request.preferences.get_value('method') + autocomplete = request.preferences.get_value('autocomplete') # chrome/chromium only supports HTTP GET.... if request.headers.get('User-Agent', '').lower().find('webkit') >= 0: - method = 'get' + method = 'GET' - autocomplete = request.preferences.get_value('autocomplete') + if method not in ('POST', 'GET'): + method = 'POST' ret = render('opensearch.xml', opensearch_method=method, autocomplete=autocomplete) - resp = Response(response=ret, status=200, mimetype="application/opensearchdescription+xml") return resp |