on master help sign in
[enh] update opensearch.xml to match major search engines opensearch.xml
commit08c13daf85311aa1799b8ea9e0990fab058c2b7f authorAdam Tauber <asciimoo@gmail.com> dateThu 18 Jun 2020, 19:37 (6 years ago) parent4a8a165
2 files changed+6−16
searx/templates/__common__/opensearch.xml+5−15 searx/webapp.py+1−1
searx/templates/__common__/opensearch.xml+5−15
@@ -6,23 +6,13 @@
66 <Image>{{ urljoin(host, url_for('static', filename='img/favicon.png')) }}</Image>
77 <LongName>searx metasearch</LongName>
88 {% if opensearch_method == 'get' %}
9− <Url type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
10− {% if autocomplete %}
11− <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
12− <Param name="format" value="x-suggestions" />
13− <Param name="q" value="{searchTerms}" />
14− </Url>
15− {% endif %}
9+ <Url rel="results" type="text/html" method="get" template="{{ host }}search?q={searchTerms}"/>
1610 {% else %}
17− <Url type="text/html" method="post" template="{{ host }}">
11+ <Url rel="results" type="text/html" method="post" template="{{ host }}">
1812 <Param name="q" value="{searchTerms}" />
1913 </Url>
20− {% if autocomplete %}
21− <!-- TODO, POST REQUEST doesn't work -->
22− <Url type="application/x-suggestions+json" method="get" template="{{ host }}autocompleter">
23− <Param name="format" value="x-suggestions" />
24− <Param name="q" value="{searchTerms}" />
25− </Url>
26− {% endif %}
14+ {% endif %}
15+ {% if autocomplete %}
16+ <Url rel="suggestions" type="application/json" template="{{ host }}autocompleter"/>
2717 {% endif %}
2818</OpenSearchDescription>
searx/webapp.py+1−1
@@ -949,7 +949,7 @@ def opensearch():
949949
950950 resp = Response(response=ret,
951951 status=200,
952− mimetype="text/xml")
952+ mimetype="application/opensearchdescription+xml")
953953 return resp
954954
955955