SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] ClientPref - don't raise exception if Accept-Language is invalid
Markus Heiserbc647fabafa4
diff --git a/searx/preferences.py b/searx/preferences.pyindex 8552305a7..aba712652 100644--- a/searx/preferences.py+++ b/searx/preferences.py@@ -331,8 +331,12 @@ class ClientPref:except (ValueError, babel.core.UnknownLocaleError):continuepairs.append((locale, qvalue))- pairs.sort(reverse=True, key=lambda x: x[1])- return cls(locale=pairs[0][0])++ locale = None+ if pairs:+ pairs.sort(reverse=True, key=lambda x: x[1])+ locale = pairs[0][0]+ return cls(locale=locale)class Preferences: