Skip to content

BinaryHTTPReceiver should remove datacontentencoding property after decoding  #284

Closed

Description

@lance

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

  1. pull in the changes from chore: Update examples to use latest sdk changes #282
  2. run the example with "A Binary One with Base 64 Encoding" from the example README
  3. watch it fail

Expected Behavior
The event should be accepted, created and validated without error.

Activity

  1. added
    type/bugSomething isn't working
    spec/0.3Support for spec v0.3
    module/transport/httpIssues related to the HTTP transport protocol implementation
    module/libRelated to the main source code
    on Jul 29, 2020
  2. self-assigned this
    on Jul 29, 2020
  3. lance commented on Jul 29, 2020

    @lance
    MemberAuthor

    Note that this is also an issue for v03 structured events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

module/libRelated to the main source codemodule/transport/httpIssues related to the HTTP transport protocol implementationspec/0.3Support for spec v0.3type/bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions