@@ -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")