Dispose httpclient response
This commit is contained in:
parent
8ddcd12348
commit
8da646e12b
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user