summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--searx/templates/courgette/opensearch.xml2
-rw-r--r--searx/templates/default/opensearch.xml2
-rw-r--r--searx/templates/oscar/opensearch.xml2
-rw-r--r--searx/webapp.py3
4 files changed, 5 insertions, 4 deletions
diff --git a/searx/templates/courgette/opensearch.xml b/searx/templates/courgette/opensearch.xml
index b77db61cb..15d3eb792 100644
--- a/searx/templates/courgette/opensearch.xml
+++ b/searx/templates/courgette/opensearch.xml
@@ -3,7 +3,7 @@
<ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/templates/default/opensearch.xml b/searx/templates/default/opensearch.xml
index b77db61cb..15d3eb792 100644
--- a/searx/templates/default/opensearch.xml
+++ b/searx/templates/default/opensearch.xml
@@ -3,7 +3,7 @@
<ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/templates/oscar/opensearch.xml b/searx/templates/oscar/opensearch.xml
index b77db61cb..15d3eb792 100644
--- a/searx/templates/oscar/opensearch.xml
+++ b/searx/templates/oscar/opensearch.xml
@@ -3,7 +3,7 @@
<ShortName>{{ instance_name }}</ShortName>
<Description>a privacy-respecting, hackable metasearch engine</Description>
<InputEncoding>UTF-8</InputEncoding>
- <Image>{{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }}</Image>
+ <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
<LongName>searx metasearch</LongName>
{% if opensearch_method == 'get' %}
<Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
diff --git a/searx/webapp.py b/searx/webapp.py
index 06859b847..665eeef24 100644
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -749,7 +749,8 @@ def opensearch():
ret = render('opensearch.xml',
opensearch_method=method,
- host=get_base_url())
+ host=get_base_url(),
+ urljoin=urljoin)
resp = Response(response=ret,
status=200,