logo

searx

My custom branche(s) on searx, a meta-search engine
commit: a41c1392f072837b60c38454072e38324e2ba029
parent: 44d3af9fb2482cd0df1a8ababbe2fdf27ab33172
Author: Adam Tauber <asciimoo@gmail.com>
Date:   Thu,  1 May 2014 10:14:47 +0200

[fix] using different opensearch url to fix chrome POST request bug

Diffstat:

Msearx/templates/opensearch.xml4++--
Msearx/webapp.py3++-
2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/searx/templates/opensearch.xml b/searx/templates/opensearch.xml @@ -4,8 +4,8 @@ <Description>Search searx</Description> <InputEncoding>UTF-8</InputEncoding> <LongName>searx metasearch</LongName> - {% if method == 'get' %} - <Url type="text/html" method="get" template="{{ host }}?q={searchTerms}"/> + {% 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" /> diff --git a/searx/webapp.py b/searx/webapp.py @@ -128,6 +128,7 @@ def render(template_name, **kwargs): return render_template(template_name, **kwargs) +@app.route('/search', methods=['GET', 'POST']) @app.route('/', methods=['GET', 'POST']) def index(): """Render index page. @@ -392,7 +393,7 @@ def opensearch(): method = 'get' ret = render('opensearch.xml', - method=method, + opensearch_method=method, host=get_base_url()) resp = Response(response=ret,