Skip to content

Improper charset handling in CloudEvents::HttpBinding#decode_event #109

@codener

Description

@codener

CloudEvents::HttpBinding#decode_event instantiates a CloudEvents::ContentType instance, which default to a charset of us-ascii. Next, it enforces that default charset onto the input string. Unfortunately, there seems to be no way to set the charset explicitly.

This lets the JSON parser crash when the input string contains non-ASCII characters (e.g. a German ä) in json versions 2.8 and above (2.18 checked). json 2.7 is less strict on encoding and does not crash.

Please check and confirm this issue. I'll be happy to prepare a PR.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions