mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-23 15:30:56 -04:00
Dispose httpclient response
This commit is contained in:
parent
8ddcd12348
commit
8da646e12b
@ -1071,7 +1071,7 @@ namespace Jellyfin.Api.Controllers
|
|||||||
{
|
{
|
||||||
var client = _httpClientFactory.CreateClient();
|
var client = _httpClientFactory.CreateClient();
|
||||||
// https://json.schedulesdirect.org/20141201/available/countries
|
// 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);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
return File(await response.Content.ReadAsStreamAsync().ConfigureAwait(false), MediaTypeNames.Application.Json);
|
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)
|
private async Task DownloadImage(string url, Guid urlHash, string pointerCachePath)
|
||||||
{
|
{
|
||||||
var httpClient = _httpClientFactory.CreateClient();
|
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 ext = response.Content.Headers.ContentType.MediaType.Split('/').Last();
|
||||||
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user