summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2013-10-30 16:30:55 +0100
committerasciimoo <asciimoo@gmail.com>2013-10-30 16:30:55 +0100
commitd1e8c2365ef432da55424c5e386c2a43dbac2abf (patch)
treec657294d361402375ca7c68b99ff6338cb6e6ea2
parentc4ae39c15efc27864c1061a3e5a9072755803f29 (diff)
[enh] https support @ opensearch.xml
-rw-r--r--searx/webapp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index a57702713..2bbaf8f86 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -115,10 +115,13 @@ def stats():
def opensearch():
global opensearch_xml
method = 'post'
+ scheme = 'http'
# chrome/chromium only supports HTTP GET....
if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
method = 'get'
- ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
+ if request.headers.get('Host', '').find('https://'):
+ scheme = 'https'
+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True, _scheme=scheme))
resp = Response(response=ret,
status=200,
mimetype="application/xml")