mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Back to HttpException
This commit is contained in:
parent
e9911b70dd
commit
25d8d85740
@ -157,7 +157,14 @@ namespace MediaBrowser.Providers.Manager
|
||||
{
|
||||
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);
|
||||
using var response = await httpClient.GetAsync(url, cancellationToken).ConfigureAwait(false);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new HttpException("Invalid image received.")
|
||||
{
|
||||
StatusCode = response.StatusCode
|
||||
};
|
||||
}
|
||||
|
||||
var contentType = response.Content.Headers.ContentType.MediaType;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user