Found additional usages for (var web = new HttpClient()) and replaced with private static readonly HttpClient HttpClient = new HttpClient();
This commit is contained in:
@@ -23,6 +23,7 @@ namespace Umbraco.Web.Install
|
||||
{
|
||||
internal class InstallHelper
|
||||
{
|
||||
private static readonly HttpClient HttpClient = new HttpClient();
|
||||
private readonly UmbracoContext _umbContext;
|
||||
private InstallationType? _installationType;
|
||||
|
||||
@@ -199,8 +200,7 @@ namespace Umbraco.Web.Install
|
||||
UmbracoVersion.Current);
|
||||
|
||||
using (var request = new HttpRequestMessage(HttpMethod.Get, requestUri))
|
||||
using (var httpClient = new HttpClient())
|
||||
using (var response = httpClient.SendAsync(request).Result)
|
||||
using (var response = HttpClient.SendAsync(request).Result)
|
||||
{
|
||||
packages = response.Content.ReadAsAsync<IEnumerable<Package>>().Result.ToList();
|
||||
}
|
||||
@@ -213,4 +213,4 @@ namespace Umbraco.Web.Install
|
||||
return packages;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user