File tree Expand file tree Collapse file tree 4 files changed +6
-2
lines changed
CloudNative.CloudEvents.NewtonsoftJson
CloudNative.CloudEvents.SystemTextJson
test/CloudNative.CloudEvents.UnitTests Expand file tree Collapse file tree 4 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -364,7 +364,7 @@ protected virtual void DecodeStructuredModeDataBase64Property(JToken dataBase64T
364364 /// <returns>The data to populate in the <see cref="CloudEvent.Data"/> property.</returns>
365365 protected virtual void DecodeStructuredModeDataProperty ( JToken dataToken , CloudEvent cloudEvent )
366366 {
367- if ( IsJsonMediaType ( cloudEvent . DataContentType ! ) )
367+ if ( IsJsonMediaType ( new ContentType ( cloudEvent . DataContentType ! ) . MediaType ) )
368368 {
369369 cloudEvent . Data = dataToken ;
370370 }
Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ protected virtual void DecodeStructuredModeDataBase64Property(JsonElement dataBa
377377 /// <returns>The data to populate in the <see cref="CloudEvent.Data"/> property.</returns>
378378 protected virtual void DecodeStructuredModeDataProperty ( JsonElement dataElement , CloudEvent cloudEvent )
379379 {
380- if ( IsJsonMediaType ( cloudEvent . DataContentType ! ) )
380+ if ( IsJsonMediaType ( new ContentType ( cloudEvent . DataContentType ! ) . MediaType ) )
381381 {
382382 cloudEvent . Data = dataElement . Clone ( ) ;
383383 }
Original file line number Diff line number Diff line change @@ -767,6 +767,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
767767 [ Theory ]
768768 [ InlineData ( null ) ]
769769 [ InlineData ( "application/json" ) ]
770+ [ InlineData ( "application/json; charset=utf-8" ) ]
770771 public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken ( string contentType )
771772 {
772773 var obj = CreateMinimalValidJObject ( ) ;
@@ -785,6 +786,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
785786 [ InlineData ( null ) ]
786787 [ InlineData ( "application/json" ) ]
787788 [ InlineData ( "application/xyz+json" ) ]
789+ [ InlineData ( "application/xyz+json; charset=utf-8" ) ]
788790 public void DecodeStructuredModeMessage_JsonContentType_NonStringValue ( string contentType )
789791 {
790792 var obj = CreateMinimalValidJObject ( ) ;
Original file line number Diff line number Diff line change @@ -787,6 +787,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
787787 [ Theory ]
788788 [ InlineData ( null ) ]
789789 [ InlineData ( "application/json" ) ]
790+ [ InlineData ( "application/json; charset=utf-8" ) ]
790791 public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken ( string contentType )
791792 {
792793 var obj = CreateMinimalValidJObject ( ) ;
@@ -805,6 +806,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
805806 [ InlineData ( null ) ]
806807 [ InlineData ( "application/json" ) ]
807808 [ InlineData ( "application/xyz+json" ) ]
809+ [ InlineData ( "application/xyz+json; charset=utf-8" ) ]
808810 public void DecodeStructuredModeMessage_JsonContentType_NonStringValue ( string contentType )
809811 {
810812 var obj = CreateMinimalValidJObject ( ) ;
You can’t perform that action at this time.
0 commit comments