Skip to content

Commit

Permalink
chore: Use inline httpClient initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
peombwa committed Oct 17, 2023
1 parent 4b71724 commit a673dec
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/lib/Helpers/ParsingHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@ namespace Microsoft.OpenApi.ApiManifest.Helpers;

internal static class ParsingHelpers
{
private static readonly Lazy<HttpClient> s_httpClient;

static ParsingHelpers()
private static readonly Lazy<HttpClient> s_httpClient = new(() => new HttpClient(new HttpClientHandler()
{
s_httpClient = new(() => new HttpClient(new HttpClientHandler()
{
SslProtocols = System.Security.Authentication.SslProtocols.Tls12,
}))
{
Value = { DefaultRequestVersion = HttpVersion.Version20 }
};
}
SslProtocols = System.Security.Authentication.SslProtocols.Tls12,
}))
{
Value = { DefaultRequestVersion = HttpVersion.Version20 }
};

internal static void ParseMap<T>(JsonElement node, T permissionsDocument, FixedFieldMap<T> handlers)
{
Expand Down

0 comments on commit a673dec

Please sign in to comment.