From 2e70cc363968d228a415ea1e5b0ce4fec55c9857 Mon Sep 17 00:00:00 2001 From: Jeff Titus Date: Fri, 17 Sep 2021 13:07:50 -0400 Subject: [PATCH] fix(runtime): ignore charset in unmarshalPayload for Content-Type comparison (#951) Signed-off-by: Jeff Titus --- internal/runtime/runtime.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/runtime/runtime.go b/internal/runtime/runtime.go index b8ffb813d..cc71f25cf 100644 --- a/internal/runtime/runtime.go +++ b/internal/runtime/runtime.go @@ -320,7 +320,9 @@ func (gr *GolangRuntime) processEventPayload(envelope types.MessageEnvelope, lc func (gr *GolangRuntime) unmarshalPayload(envelope types.MessageEnvelope, target interface{}) error { var err error - switch envelope.ContentType { + contentType := strings.Split(envelope.ContentType, ";")[0] + + switch contentType { case common.ContentTypeJSON: err = json.Unmarshal(envelope.Payload, target)