Skip to content

Commit

Permalink
馃 Don't send None to Locale.parse
Browse files Browse the repository at this point in the history
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
  • Loading branch information
foosel committed Mar 2, 2023
1 parent 588a1c4 commit 59054cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/octoprint/server/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ def _get_locale(self):
):
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")
Expand Down

0 comments on commit 59054cc

Please sign in to comment.