diff options
| author | asciimoo <asciimoo@gmail.com> | 2014-01-30 13:30:41 +0100 |
|---|---|---|
| committer | asciimoo <asciimoo@gmail.com> | 2014-01-30 13:30:41 +0100 |
| commit | 941e5fb2c4dc8f9c02709c87e5f096d2adef246a (patch) | |
| tree | d5ca39512ebc821178aca2d84c03f60cf990a413 /searx/webapp.py | |
| parent | 08136f5ba2c579e222d2e0e8179cf21d8f4a461c (diff) | |
[enh][fix] opensearch separation ++ better chrome support
Diffstat (limited to 'searx/webapp.py')
| -rw-r--r-- | searx/webapp.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/searx/webapp.py b/searx/webapp.py index 42206435e..820775c8b 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -48,19 +48,6 @@ favicons = ['wikipedia', 'youtube', 'vimeo', 'soundcloud', 'twitter', 'stackoverflow', 'github'] -opensearch_xml = '''<?xml version="1.0" encoding="utf-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>searx</ShortName> - <Description>Search searx</Description> - <InputEncoding>UTF-8</InputEncoding> - <LongName>searx meta search engine</LongName> - <Url type="text/html" method="{method}" template="{host}"> - <Param name="q" value="{{searchTerms}}" /> - </Url> -</OpenSearchDescription> -''' - - @babel.localeselector def get_locale(): locale = request.accept_languages.best_match(settings['locales'].keys()) @@ -298,13 +285,11 @@ Disallow: /engines @app.route('/opensearch.xml', methods=['GET']) def opensearch(): - global opensearch_xml method = 'post' # chrome/chromium only supports HTTP GET.... if request.headers.get('User-Agent', '').lower().find('webkit') >= 0: method = 'get' - base_url = get_base_url() - ret = opensearch_xml.format(method=method, host=base_url) + ret = render('opensearch.xml', method=method, host=get_base_url()) resp = Response(response=ret, status=200, mimetype="application/xml") |