summaryrefslogtreecommitdiff
path: root/searx
diff options
context:
space:
mode:
authorAdam Tauber <asciimoo@gmail.com>2020-06-18 19:37:14 +0200
committerAdam Tauber <asciimoo@gmail.com>2020-06-18 19:38:13 +0200
commit08c13daf85311aa1799b8ea9e0990fab058c2b7f (patch)
treef2b023098602c9ec3030fee69922eeabaf2f10b7 /searx
parent4a8a16559af18ab38d796aad303a827c8c640fa2 (diff)
downloadsearxng-08c13daf85311aa1799b8ea9e0990fab058c2b7f.tar.gz
searxng-08c13daf85311aa1799b8ea9e0990fab058c2b7f.zip
[enh] update opensearch.xml to match major search engines opensearch.xml
Diffstat (limited to 'searx')
-rw-r--r--searx/templates/__common__/opensearch.xml20
-rwxr-xr-xsearx/webapp.py2
2 files changed, 6 insertions, 16 deletions
diff --git a/searx/templates/__common__/opensearch.xml b/searx/templates/__common__/opensearch.xml
index 15d3eb792..27634245f 100644
--- a/searx/templates/__common__/opensearch.xml
+++ b/searx/templates/__common__/opensearch.xml
@@ -6,23 +6,13 @@
<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}"/>
- {% if autocomplete %}
- <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
- <Param name="format" value="x-suggestions" />
- <Param name="q" value="{searchTerms}" />
- </Url>
- {% endif %}
+ <Url rel="results" type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
{% else %}
- <Url type="text/html" method="post" template="{{ host }}">
+ <Url rel="results" type="text/html" method="post" template="{{ host }}">
<Param name="q" value="{searchTerms}" />
</Url>
- {% if autocomplete %}
- <!-- TODO, POST REQUEST doesn't work -->
- <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
- <Param name="format" value="x-suggestions" />
- <Param name="q" value="{searchTerms}" />
- </Url>
- {% endif %}
+ {% endif %}
+ {% if autocomplete %}
+ <Url rel="suggestions" type="application/json" template="{{ host }}autocompleter"/>
{% endif %}
</OpenSearchDescription>
diff --git a/searx/webapp.py b/searx/webapp.py
index 68be25584..35495a0ff 100755
--- a/searx/webapp.py
+++ b/searx/webapp.py
@@ -949,7 +949,7 @@ def opensearch():
resp = Response(response=ret,
status=200,
- mimetype="text/xml")
+ mimetype="application/opensearchdescription+xml")
return resp