Merge branch 'master' of https://github.com/asciimoo/searx into filtron

This commit is contained in:
Markus Heiser 2020-03-21 18:46:26 +01:00
commit baddb8d3eb
1 changed files with 3 additions and 1 deletions

View File

@ -178,9 +178,12 @@ flask_babel.get_translations = _get_translations
def _get_browser_language(request, lang_list): def _get_browser_language(request, lang_list):
for lang in request.headers.get("Accept-Language", "en").split(","): for lang in request.headers.get("Accept-Language", "en").split(","):
if ';' in lang:
lang = lang.split(';')[0]
locale = match_language(lang, lang_list, fallback=None) locale = match_language(lang, lang_list, fallback=None)
if locale is not None: if locale is not None:
return locale return locale
return settings['search']['default_lang'] or 'en'
@babel.localeselector @babel.localeselector
@ -647,7 +650,6 @@ def index():
response.headers.add('Content-Disposition', cont_disp) response.headers.add('Content-Disposition', cont_disp)
return response return response
elif output_format == 'rss': elif output_format == 'rss':
print(results)
response_rss = render( response_rss = render(
'opensearch_response_rss.xml', 'opensearch_response_rss.xml',
results=results, results=results,