Skip to content

Commit e5b0cb8

Browse files
Simplify HttpClientHandler disposal pattern per code review feedback
Co-authored-by: christianhelle <710400+christianhelle@users.noreply.github.com>
1 parent b405ad0 commit e5b0cb8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/HttpGenerator.Core/OpenApiDocumentFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ private static string DowngradeOpenApi31To30(string content)
6666
/// <returns>The content of the HTTP request.</returns>
6767
private static async Task<string> GetHttpContent(string openApiPath)
6868
{
69-
using var httpMessageHandler = new HttpClientHandler
69+
var httpMessageHandler = new HttpClientHandler
7070
{
7171
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate,
7272
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => true
7373
};
74-
using var http = new HttpClient(httpMessageHandler, disposeHandler: false);
74+
using var http = new HttpClient(httpMessageHandler, disposeHandler: true);
7575
var content = await http.GetStringAsync(openApiPath);
7676
return content;
7777
}

0 commit comments

Comments
 (0)