Skip to content

fix: ensure that data encoded as base64 is parsed as an object #285

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

Merged
merged 2 commits into from
Jul 30, 2020

Conversation

lance
Copy link
Member

@lance lance commented Jul 29, 2020

Proposed Changes

Parse incoming data as JSON for an event with datacontentencoding set to "base64"
and a content type of application/json or application/cloudevents+json.

Description

The 0.3 specification states that datacontentencoding may be set to base64.
If an incoming event arrives over HTTP with this value set, and the content type
is either application/json or application/cloudevents+json, then we should ensure
that the data is decoded and parsed, and the datacontentencoding property is
removed.

Signed-off-by: Lance Ball [email protected]

The 0.3 specification states that `datacontentencoding` may be set to base64.
If an incoming event arrives over HTTP with this value set, and the content type
is either application/json or application/cloudevents+json, then ensure that
the data is decoded and parsed.

Fixes: cloudevents#284
See: cloudevents#282

Signed-off-by: Lance Ball <[email protected]>
@lance lance added spec/0.3 Support for spec v0.3 module/transport/http Issues related to the HTTP transport protocol implementation type/fix A change that fixes something that is broken module/lib Related to the main source code labels Jul 29, 2020
@lance lance requested a review from a team July 29, 2020 20:06
@lance lance self-assigned this Jul 29, 2020
@lance lance requested review from danbev, grant, helio-frota and lholmquist and removed request for a team July 29, 2020 20:06
@lance lance merged commit ed9ea95 into cloudevents:master Jul 30, 2020
@lholmquist lholmquist mentioned this pull request Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/lib Related to the main source code module/transport/http Issues related to the HTTP transport protocol implementation spec/0.3 Support for spec v0.3 type/fix A change that fixes something that is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BinaryHTTPReceiver should remove datacontentencoding property after decoding
3 participants