From 174daf703b341455c3320b61034cdb74bee9b55d Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 20 Oct 2013 22:37:55 +0200 Subject: [enh] chrome opensearch support --- searx/webapp.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'searx/webapp.py') 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 = ''' Search searx UTF-8 searx meta search engine - + @@ -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") -- cgit v1.2.3