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 HttpUtil.getCharset to not throw IllegalCharsetNameException #9439

Merged
merged 1 commit into from Aug 10, 2019

Conversation

@noSim
Copy link
Contributor

commented Aug 9, 2019

Motivation:

If the HttpUtil.getCharset method is called with an illegal charset like
"charset=!illegal!" it throws an IllegalCharsetNameException. But the javadoc
states, that defaultCharset is returned if incorrect header value. Since the
client sending the request sets the header value this should not crash.

Modification:

HttpUtil.getCharset catches the IllegalCharsetNameException and returns the
defualt value.

Result:

HttpUtil.getCharset does not throw IllegalCharsetNameException any more.

Simon Baechle
Fix HttpUtil.getCharset to not throw illegal charset exception
Motivation:

If the HttpUtil.getCharset method is called with an illegal charset like
"charset=!illegal!" it throws an IllegalCharsetNameException. But the javadoc
states, that defaultCharset is returned if incorrect header value. Since the
client sending the request sets the header value this should not crash.

Modification:

HttpUtil.getCharset catches the IllegalCharsetNameException and returns the
defualt value.

Result:

HttpUtil.getCharset does not throw IllegalCharsetNameException any more.
@netty-bot

This comment has been minimized.

Copy link

commented Aug 9, 2019

Can one of the admins verify this patch?

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Aug 9, 2019

@netty-bot test this please

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

@noSim good catch!

@normanmaurer normanmaurer merged commit e8c2986 into netty:master Aug 10, 2019

3 checks passed

pull request validation (centos6-java11) Build finished.
Details
pull request validation (centos6-java12) Build finished.
Details
pull request validation (centos6-java8) Build finished.
Details

normanmaurer added a commit that referenced this pull request Aug 10, 2019

Fix HttpUtil.getCharset to not throw illegal charset exception (#9439)
Motivation:

If the HttpUtil.getCharset method is called with an illegal charset like
"charset=!illegal!" it throws an IllegalCharsetNameException. But the javadoc
states, that defaultCharset is returned if incorrect header value. Since the
client sending the request sets the header value this should not crash.

Modification:

HttpUtil.getCharset catches the IllegalCharsetNameException and returns the
defualt value.

Result:

HttpUtil.getCharset does not throw IllegalCharsetNameException any more.
@normanmaurer

This comment has been minimized.

Copy link
Member

commented Aug 10, 2019

Cherry-picked into 4.1 (cbc8fc4)

@normanmaurer normanmaurer added this to the 4.1.39.Final milestone Aug 10, 2019

@normanmaurer normanmaurer self-assigned this Aug 10, 2019

@normanmaurer normanmaurer added the defect label Aug 10, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.