File tree Expand file tree Collapse file tree
src/SignhostAPIClient/Rest Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -243,11 +243,20 @@ public async Task<Stream> GetReceiptAsync(
243243 nameof ( transactionId ) ) ;
244244 }
245245
246- var result = await client
247- . GetStreamAsync ( "file" . JoinPaths ( "receipt" , transactionId ) )
246+ var response = await client
247+ . GetAsync (
248+ "file" . JoinPaths ( "receipt" , transactionId ) ,
249+ cancellationToken )
250+ . EnsureSignhostSuccessStatusCodeAsync ( )
248251 . ConfigureAwait ( false ) ;
249252
250- return result ;
253+ return await response . Content
254+ #if NET8_0_OR_GREATER
255+ . ReadAsStreamAsync ( cancellationToken )
256+ #else
257+ . ReadAsStreamAsync ( )
258+ #endif
259+ . ConfigureAwait ( false ) ;
251260 }
252261
253262 /// <inheritdoc />
@@ -272,11 +281,20 @@ public async Task<Stream> GetDocumentAsync(
272281 nameof ( fileId ) ) ;
273282 }
274283
275- var result = await client
276- . GetStreamAsync ( "transaction" . JoinPaths ( transactionId , "file" , fileId ) )
284+ var response = await client
285+ . GetAsync (
286+ "transaction" . JoinPaths ( transactionId , "file" , fileId ) ,
287+ cancellationToken )
288+ . EnsureSignhostSuccessStatusCodeAsync ( )
277289 . ConfigureAwait ( false ) ;
278290
279- return result ;
291+ return await response . Content
292+ #if NET8_0_OR_GREATER
293+ . ReadAsStreamAsync ( cancellationToken )
294+ #else
295+ . ReadAsStreamAsync ( )
296+ #endif
297+ . ConfigureAwait ( false ) ;
280298 }
281299
282300 /// <inheritdoc/>
You can’t perform that action at this time.
0 commit comments