@@ -165,7 +165,11 @@ def opensearch():
165165 method = 'get'
166166 if request.is_secure:
167167 scheme = 'https'
168− ret = opensearch_xml.format(method=method, host=url_for('index', _external=True, _scheme=scheme))
168+ if settings.hostname:
169+ hostname = '{0}://{1}/'.format(scheme,settings.hostname)
170+ else:
171+ hostname = url_for('index', _external=True, _scheme=scheme)
172+ ret = opensearch_xml.format(method=method, host=hostname)
169173 resp = Response(response=ret,
170174 status=200,
171175 mimetype="application/xml")