1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00
The opensearch method is now the method set in the preferences.

As before, POST by default and GET for Chrome/Chromium which doesn't
handle POST
This commit is contained in:
Luc Didry 2015-03-15 20:07:50 +01:00
parent 22c4195c89
commit 7004de6aa7

View File

@ -687,6 +687,10 @@ Disallow: /preferences
@app.route('/opensearch.xml', methods=['GET']) @app.route('/opensearch.xml', methods=['GET'])
def opensearch(): def opensearch():
method = 'post' method = 'post'
if request.cookies.get('method', 'POST') == 'GET':
method = 'get'
# chrome/chromium only supports HTTP GET.... # chrome/chromium only supports HTTP GET....
if request.headers.get('User-Agent', '').lower().find('webkit') >= 0: if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
method = 'get' method = 'get'