on master help sign in
[enh] https support @ opensearch.xml
commitd1e8c2365ef432da55424c5e386c2a43dbac2abf authorasciimoo <asciimoo@gmail.com> dateWed 30 Oct 2013, 16:30 (13 years ago) parentc4ae39c
1 file changed+4−1
searx/webapp.py+4−1
searx/webapp.py+4−1
@@ -115,10 +115,13 @@ def stats():
115115def opensearch():
116116 global opensearch_xml
117117 method = 'post'
118+ scheme = 'http'
118119 # chrome/chromium only supports HTTP GET....
119120 if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
120121 method = 'get'
121− ret = opensearch_xml.format(method=method, host=url_for('index', _external=True))
122+ if request.headers.get('Host', '').find('https://'):
123+ scheme = 'https'
124+ ret = opensearch_xml.format(method=method, host=url_for('index', _external=True, _scheme=scheme))
122125 resp = Response(response=ret,
123126 status=200,
124127 mimetype="application/xml")