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

fix: Fail-over to UTF-8 if Accept-Charset is invalid #4296

Merged
merged 2 commits into from Sep 20, 2023

Conversation

johanandren
Copy link
Member

@johanandren johanandren commented Aug 16, 2023

References #4295

Follows the suggestion in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Charset and falls back to UTF-8 when the requested Accept-Charset is not a valid charset (instead of failing with a NIO exception and logging noise)

@johanandren johanandren force-pushed the wip-4295-invalid-accept-charset-causes-http-500 branch from dab225e to b0c7817 Compare September 6, 2023 13:12
@johanandren johanandren added this to the 10.6.0 milestone Sep 6, 2023
Copy link
Member

@patriknw patriknw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

} catch {
case _: java.nio.charset.UnsupportedCharsetException =>
// request contained an invalid charset name, fall back to UTF-8
HttpCharsets.`UTF-8`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so this would be the same as if the header was not specified? effectively ignoring the header if it's invalid, which is along the lines of the recommendation in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Charset

@patriknw patriknw merged commit a943f89 into main Sep 20, 2023
17 checks passed
@patriknw patriknw deleted the wip-4295-invalid-accept-charset-causes-http-500 branch September 20, 2023 11:43
@johanandren johanandren removed this from the 10.6.0-M1 milestone Sep 20, 2023
@patriknw patriknw modified the milestone: 10.6.0-M1 Sep 20, 2023
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.

None yet

2 participants