mirror of
https://github.com/searxng/searxng.git
synced 2024-12-21 08:46:28 +00:00
[enh] https support @ opensearch.xml
This commit is contained in:
parent
c4ae39c15e
commit
d1e8c2365e
1 changed files with 4 additions and 1 deletions
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue