From bc81eda64bccbdb24c5f482563cac7ba88ef1027 Mon Sep 17 00:00:00 2001 From: Adam Tauber Date: Wed, 2 Mar 2016 11:51:11 +0100 Subject: [PATCH] [fix] opensearch image issue - closes #507 --- searx/templates/courgette/opensearch.xml | 2 +- searx/templates/default/opensearch.xml | 2 +- searx/templates/oscar/opensearch.xml | 2 +- searx/webapp.py | 3 ++- 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 @@ {{ instance_name }} a privacy-respecting, hackable metasearch engine UTF-8 - {{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }} + {{ urljoin(host, url_for('static', filename='img/favicon.png')) }} searx metasearch {% if opensearch_method == 'get' %} 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 @@ {{ instance_name }} a privacy-respecting, hackable metasearch engine UTF-8 - {{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }} + {{ urljoin(host, url_for('static', filename='img/favicon.png')) }} searx metasearch {% if opensearch_method == 'get' %} 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 @@ {{ instance_name }} a privacy-respecting, hackable metasearch engine UTF-8 - {{ host }}{{ url_for('static', filename='img/favicon.png') | replace("/", "", 1) }} + {{ urljoin(host, url_for('static', filename='img/favicon.png')) }} searx metasearch {% if opensearch_method == 'get' %} 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,