|
@@ -115,10 +115,13 @@ def stats():
|
115
|
115
|
def opensearch():
|
116
|
116
|
global opensearch_xml
|
117
|
117
|
method = 'post'
|
|
118
|
+ scheme = 'http'
|
118
|
119
|
# chrome/chromium only supports HTTP GET....
|
119
|
120
|
if request.headers.get('User-Agent', '').lower().find('webkit') >= 0:
|
120
|
121
|
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))
|
122
|
125
|
resp = Response(response=ret,
|
123
|
126
|
status=200,
|
124
|
127
|
mimetype="application/xml")
|