|
@@ -37,7 +37,7 @@ opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?>
|
37
|
37
|
<Description>Search searx</Description>
|
38
|
38
|
<InputEncoding>UTF-8</InputEncoding>
|
39
|
39
|
<LongName>searx meta search engine</LongName>
|
40
|
|
- <Url type="text/html" method="post" template="{host}">
|
|
40
|
+ <Url type="text/html" method="{method}" template="{host}">
|
41
|
41
|
<Param name="q" value="{{searchTerms}}" />
|
42
|
42
|
</Url>
|
43
|
43
|
</OpenSearchDescription>
|
|
@@ -105,7 +105,10 @@ def fav():
|
105
|
105
|
@app.route('/opensearch.xml', methods=['GET'])
|
106
|
106
|
def opensearch():
|
107
|
107
|
global opensearch_xml
|
108
|
|
- ret = opensearch_xml.format(host=url_for('index', _external=True))
|
|
108
|
+ method = 'post'
|
|
109
|
+ if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
|
|
110
|
+ method = 'get'
|
|
111
|
+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
|
109
|
112
|
resp = Response(response=ret,
|
110
|
113
|
status=200,
|
111
|
114
|
mimetype="application/xml")
|