File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 44using System . Net ;
55using System . Net . Http ;
66using System . Net . Http . Headers ;
7- using System . Text ;
87using System . Threading ;
98using System . Threading . Tasks ;
109using System . Net . Mime ;
@@ -200,12 +199,14 @@ private Task<HttpResponseMessage> SendJsonRequestAsync(
200199
201200 if ( request is { } )
202201 {
203- // Only serialize to string if signing is required,
204- string json = JsonSerializer . Serialize ( request , request . GetType ( ) , SerializerOptions . Default ) ;
202+ byte [ ] jsonBytes = JsonSerializer . SerializeToUtf8Bytes ( request , request . GetType ( ) , SerializerOptions . Default ) ;
205203
206- signer . Body ( json ) ;
204+ signer . Body ( jsonBytes ) ;
207205
208- httpContent = new StringContent ( json , Encoding . UTF8 , MediaTypeNames . Application . Json ) ;
206+ httpContent = new ByteArrayContent ( jsonBytes )
207+ {
208+ Headers = { ContentType = new MediaTypeHeaderValue ( MediaTypeNames . Application . Json ) }
209+ } ;
209210 }
210211
211212 if ( ! string . IsNullOrWhiteSpace ( idempotencyKey ) )
Original file line number Diff line number Diff line change 3333 <PackageReference Include =" Microsoft.Extensions.Http" Version =" 10.0.0" />
3434 <PackageReference Include =" Microsoft.Extensions.Caching.Memory" Version =" 10.0.0" />
3535 <PackageReference Include =" OneOf" Version =" 3.0.271" />
36- <PackageReference Include =" TrueLayer.Signing" Version =" 0.2.2 " />
36+ <PackageReference Include =" TrueLayer.Signing" Version =" 0.2.4 " />
3737
3838 <!-- Source Link support for GitHub -->
3939 <PackageReference Include =" Microsoft.SourceLink.GitHub" Version =" 8.0.0" PrivateAssets =" All" />
You can’t perform that action at this time.
0 commit comments