Skip to content

Commit

Permalink
fix: check if stream can be read
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpop-zengenti committed Oct 15, 2024
1 parent 02866cc commit 3973479
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public async Task<EndpointResponse> Invoke(
else
{
var endpointResponseStream = endpointResponse.ToStream(true);
if (endpointResponseStream is { Length: > 0 } and MemoryStream stream)
if (endpointResponseStream is MemoryStream stream and { CanSeek: true, Length: > 0 } and)
{
using var reader = new StreamReader(stream, leaveOpen: true);
responseContent = await reader.ReadToEndAsync(cancellationToken);
Expand Down

0 comments on commit 3973479

Please sign in to comment.