Skip to content

Commit

Permalink
fix: disposal of response object
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Nov 13, 2024
1 parent 5242e10 commit bfe2983
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dotnet/src/Functions/Functions.OpenApi/DocumentLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ internal static async Task<Stream> LoadDocumentFromUriAsStreamAsync(
{
//disposing the response disposes the stream
var response = await LoadDocumentResponseFromUriAsync(uri, logger, httpClient, authCallback, userAgent, cancellationToken).ConfigureAwait(false);
return await response.Content.ReadAsStreamAndTranslateExceptionAsync().ConfigureAwait(false);
var stream = await response.Content.ReadAsStreamAndTranslateExceptionAsync().ConfigureAwait(false);
return new HttpResponseStream(stream, response);
}

private static async Task<HttpResponseMessage> LoadDocumentResponseFromUriAsync(
Expand Down

0 comments on commit bfe2983

Please sign in to comment.