aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-08-16 10:57:01 -0600
committercrobibero <cody@robibe.ro>2020-08-16 10:57:01 -0600
commit8da646e12b6122b3a73830eb9cbf3e39033d8ba3 (patch)
treeeda7f142c6b0eebb0587d133f0721d5ebd73c0e4
parent8ddcd12348da48c8a07a7f897c014974995af6d9 (diff)
Dispose httpclient response
-rw-r--r--Jellyfin.Api/Controllers/LiveTvController.cs2
-rw-r--r--Jellyfin.Api/Controllers/RemoteImageController.cs2
2 files changed, 2 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/LiveTvController.cs b/Jellyfin.Api/Controllers/LiveTvController.cs
index 2838361d7..9d8ec9f75 100644
--- a/Jellyfin.Api/Controllers/LiveTvController.cs
+++ b/Jellyfin.Api/Controllers/LiveTvController.cs
@@ -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);
diff --git a/Jellyfin.Api/Controllers/RemoteImageController.cs b/Jellyfin.Api/Controllers/RemoteImageController.cs
index e5b038186..a203c50b9 100644
--- a/Jellyfin.Api/Controllers/RemoteImageController.cs
+++ b/Jellyfin.Api/Controllers/RemoteImageController.cs
@@ -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);