Skip to content

Conversation

@johanandren
Copy link
Contributor

@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
Contributor

@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
Contributor

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
@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.

3 participants