Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent crashes on use_locale #199

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

veigaribo
Copy link
Contributor

Currently, on use_locale, if the server receives a malformed Accept-Language header, it will panic:

.expect("Client should provide a list of valid unicode locales");

Changed it so the offending language (or the entire header, see use_locales) is ignored and a warning is logged instead.

The current implementation will also panic if there are no client languages whatsoever. Fixed that case too.

I tried to do it in such a way as to minimize clones.

@maccesch maccesch merged commit 4fb7306 into Synphonyte:main Nov 14, 2024
4 checks passed
@maccesch
Copy link
Contributor

Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants