Closed
Description
Expected Behavior
Following crashes as CloudEvent attempts to unmarshall this as a binary event
from cloudevents.sdk.http_events import CloudEvent
import json
data = json.dumps({"id": "123", "source": "<source url>", "type": "com.sample.type", "specversion": "1.0"})
headers = {}
event = CloudEvent.from_http(data, headers)
Actual Behavior
from cloudevents.sdk.http_events import CloudEvent
import json
data = json.dumps({"id": "123", "source": "<source url>", "type": "com.sample.type", "specversion": "1.0"})
headers = {"Content-Type": "application/cloudevents+json"}
event = CloudEvent.from_http(data, headers)
We have not registered this content type with the IANA yet as seen here therefore we shouldn't expect all requests to have this header. We should instead check the http headers to determine whether event is structured or binary.
Metadata
Metadata
Assignees
Labels
No labels