🥅 Don't send None to Locale.parse

The latest version of Babel no longer supports this
but raises an error, which in turn leads to a
500 Server Error response here.

To fix this, we set a default for best_match.

Closes #4744
This commit is contained in:
Gina Häußge committed 2023-03-02 15:57:43 +01:00
1 parent 588a1c4cc8
commit 59054cc1e5
1 file changed
+1 -1
+1 -1
View File
@@ -1349,7 +1349,7 @@ class Server:
):
return Locale.negotiate([default_language], LANGUAGES)
return Locale.parse(request.accept_languages.best_match(LANGUAGES))
return Locale.parse(request.accept_languages.best_match(LANGUAGES, default="en"))
def _setup_heartbeat_logging(self):
logger = logging.getLogger(__name__ + ".heartbeat")