Dispose httpclient response

This commit is contained in:
crobibero 2020-08-16 10:57:01 -06:00
parent 8ddcd12348
commit 8da646e12b
2 changed files with 2 additions and 2 deletions

View File

@ -1071,7 +1071,7 @@ namespace Jellyfin.Api.Controllers
{
var client = _httpClientFactory.CreateClient();
// https://json.schedulesdirect.org/20141201/available/countries
var response = await client.GetAsync("https://json.schedulesdirect.org/20141201/available/countries")
using var response = await client.GetAsync("https://json.schedulesdirect.org/20141201/available/countries")
.ConfigureAwait(false);
return File(await response.Content.ReadAsStreamAsync().ConfigureAwait(false), MediaTypeNames.Application.Json);

View File

@ -245,7 +245,7 @@ namespace Jellyfin.Api.Controllers
private async Task DownloadImage(string url, Guid urlHash, string pointerCachePath)
{
var httpClient = _httpClientFactory.CreateClient();
var response = await httpClient.GetAsync(url).ConfigureAwait(false);
using var response = await httpClient.GetAsync(url).ConfigureAwait(false);
var ext = response.Content.Headers.ContentType.MediaType.Split('/').Last();
var fullCachePath = GetFullCachePath(urlHash + "." + ext);