mirror of
https://github.com/searxng/searxng.git
synced 2025-07-24 13:49:26 +02:00
[enh] optionally configurable hostname - edit settings.py
This commit is contained in:
parent
fd6e730d50
commit
141b04c6dd
2 changed files with 7 additions and 1 deletions
|
@ -165,7 +165,11 @@ def opensearch():
|
|||
method = 'get'
|
||||
if request.is_secure:
|
||||
scheme = 'https'
|
||||
ret = opensearch_xml.format(method=method, host=url_for('index', _external=True, _scheme=scheme))
|
||||
if settings.hostname:
|
||||
hostname = '{0}://{1}/'.format(scheme,settings.hostname)
|
||||
else:
|
||||
hostname = url_for('index', _external=True, _scheme=scheme)
|
||||
ret = opensearch_xml.format(method=method, host=hostname)
|
||||
resp = Response(response=ret,
|
||||
status=200,
|
||||
mimetype="application/xml")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue