Closed
Description
Describe the Bug
When the BinaryHTTPReceiver
accepts an incoming event, one of the first things it does is check to see if the event has its data encoded, by looking for the CloudEvent#datacontentencoding
property. If the data is encoded, and the content type is application/json
, then it will parse the data so that to the user, it ultimately is in Object
form.
However, when validating the event, the validator checks to see if the datacontentencoding
is set and if so, will throw a ValidationError
if it's not a string or Buffer.
This is only relevant for v0.3 events, since datacontentencoding
is not part of the 1.0 specification.
Steps to Reproduce
- pull in the changes from chore: Update examples to use latest sdk changes #282
- run the example with "A Binary One with Base 64 Encoding" from the example README
- watch it fail
Expected Behavior
The event should be accepted, created and validated without error.