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
364
364
/// <returns>The data to populate in the <see cref="CloudEvent.Data"/> property.</returns>
365
365
protected virtual void DecodeStructuredModeDataProperty ( JToken dataToken , CloudEvent cloudEvent )
366
366
{
367
- if ( IsJsonMediaType ( cloudEvent . DataContentType ! ) )
367
+ if ( IsJsonMediaType ( new ContentType ( cloudEvent . DataContentType ! ) . MediaType ) )
368
368
{
369
369
cloudEvent . Data = dataToken ;
370
370
}
Original file line number Diff line number Diff line change @@ -377,7 +377,7 @@ protected virtual void DecodeStructuredModeDataBase64Property(JsonElement dataBa
377
377
/// <returns>The data to populate in the <see cref="CloudEvent.Data"/> property.</returns>
378
378
protected virtual void DecodeStructuredModeDataProperty ( JsonElement dataElement , CloudEvent cloudEvent )
379
379
{
380
- if ( IsJsonMediaType ( cloudEvent . DataContentType ! ) )
380
+ if ( IsJsonMediaType ( new ContentType ( cloudEvent . DataContentType ! ) . MediaType ) )
381
381
{
382
382
cloudEvent . Data = dataElement . Clone ( ) ;
383
383
}
Original file line number Diff line number Diff line change @@ -767,6 +767,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
767
767
[ Theory ]
768
768
[ InlineData ( null ) ]
769
769
[ InlineData ( "application/json" ) ]
770
+ [ InlineData ( "application/json; charset=utf-8" ) ]
770
771
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken ( string contentType )
771
772
{
772
773
var obj = CreateMinimalValidJObject ( ) ;
@@ -785,6 +786,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
785
786
[ InlineData ( null ) ]
786
787
[ InlineData ( "application/json" ) ]
787
788
[ InlineData ( "application/xyz+json" ) ]
789
+ [ InlineData ( "application/xyz+json; charset=utf-8" ) ]
788
790
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue ( string contentType )
789
791
{
790
792
var obj = CreateMinimalValidJObject ( ) ;
Original file line number Diff line number Diff line change @@ -787,6 +787,7 @@ public void DecodeStructuredModeMessage_NonJsonContentType_JsonStringToken(strin
787
787
[ Theory ]
788
788
[ InlineData ( null ) ]
789
789
[ InlineData ( "application/json" ) ]
790
+ [ InlineData ( "application/json; charset=utf-8" ) ]
790
791
public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken ( string contentType )
791
792
{
792
793
var obj = CreateMinimalValidJObject ( ) ;
@@ -805,6 +806,7 @@ public void DecodeStructuredModeMessage_JsonContentType_JsonStringToken(string c
805
806
[ InlineData ( null ) ]
806
807
[ InlineData ( "application/json" ) ]
807
808
[ InlineData ( "application/xyz+json" ) ]
809
+ [ InlineData ( "application/xyz+json; charset=utf-8" ) ]
808
810
public void DecodeStructuredModeMessage_JsonContentType_NonStringValue ( string contentType )
809
811
{
810
812
var obj = CreateMinimalValidJObject ( ) ;
You can’t perform that action at this time.
0 commit comments