summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index 517633ac6..fd208504b 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -37,7 +37,7 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
<Description>Search searx</Description>
<InputEncoding>UTF-8</InputEncoding>
<LongName>searx meta search engine</LongName>
- <Url type="text/html" method="post" template="{host}">
+ <Url type="text/html" method="{method}" template="{host}">
<Param name="q" value="{{searchTerms}}" />
</Url>
</OpenSearchDescription>
@@ -105,7 +105,10 @@ def fav():
@app.route('/opensearch.xml', methods=['GET'])
def opensearch():
global opensearch_xml
- ret = opensearch_xml.format(host=url_for('index', _external=True))
+ method = 'post'
+ if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
+ method = 'get'
+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
resp = Response(response=ret,
status=200,
mimetype="application/xml")