mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-23 21:16:52 +01:00
Workaround for invalid CA2000 warning
This commit is contained in:
@@ -46,16 +46,25 @@ namespace Tgstation.Server.Host.Core
|
||||
public IHttpClient CreateClient()
|
||||
{
|
||||
logger.LogTrace("Creating client...");
|
||||
var client = new Tgstation.Server.Common.HttpClient(
|
||||
httpClientFactory.CreateClient());
|
||||
var innerClient = httpClientFactory.CreateClient();
|
||||
try
|
||||
{
|
||||
client.DefaultRequestHeaders.UserAgent.Add(assemblyInformationProvider.ProductInfoHeaderValue);
|
||||
return client;
|
||||
var client = new Tgstation.Server.Common.HttpClient(httpClientFactory.CreateClient());
|
||||
innerClient = null; // CA2000
|
||||
try
|
||||
{
|
||||
client.DefaultRequestHeaders.UserAgent.Add(assemblyInformationProvider.ProductInfoHeaderValue);
|
||||
return client;
|
||||
}
|
||||
catch
|
||||
{
|
||||
client.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
client.Dispose();
|
||||
innerClient?.Dispose();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user