summaryrefslogtreecommitdiff
path: root/searx/webapp.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2013-12-26 01:53:26 +0100
committerasciimoo <asciimoo@gmail.com>2013-12-26 01:53:26 +0100
commit141b04c6dde9df0e6b7f2e2b30ec8131429c8932 (patch)
tree39029e2ba95098954da11d944ca29e8c44466e99 /searx/webapp.py
parentfd6e730d505eabaac6361d23c2d0eb3eab923bcf (diff)
[enh] optionally configurable hostname - edit settings.py
Diffstat (limited to 'searx/webapp.py')
-rw-r--r--searx/webapp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/searx/webapp.py b/searx/webapp.py
index bbc151a5d..6ac0046f1 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -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")