Skip to content
This repository was archived by the owner on Dec 11, 2023. It is now read-only.

Commit 2e35ee4

Browse files
authored
Merge pull request #30 from triggermesh/empty-cetype
Handle empty CE Type attribute
2 parents c5b99c1 + 052e0ff commit 2e35ee4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/converter/cloudevents/cloudevents.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ func New() (*CloudEvent, error) {
5252
}
5353

5454
func (ce *CloudEvent) Convert(data []byte) ([]byte, error) {
55+
// If response format is set to CloudEvents
56+
// and CE_TYPE is empty,
57+
// then reply with the empty response
58+
if ce.EventType == "" {
59+
return nil, nil
60+
}
61+
5562
b := ceBody{
5663
ID: uuid.NewString(),
5764
Type: ce.EventType,

0 commit comments

Comments
 (0)