aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Providers/Manager/ProviderManager.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs
index e43da1350..010e9c3b6 100644
--- a/MediaBrowser.Providers/Manager/ProviderManager.cs
+++ b/MediaBrowser.Providers/Manager/ProviderManager.cs
@@ -200,12 +200,20 @@ namespace MediaBrowser.Providers.Manager
// TODO: Isolate this hack into the tvh plugin
if (string.IsNullOrEmpty(contentType))
{
+ // Special case for imagecache
if (url.Contains("/imagecache/", StringComparison.OrdinalIgnoreCase))
{
contentType = MediaTypeNames.Image.Png;
}
else
{
+ // Deduce content type from file extension
+ contentType = MimeTypes.GetMimeType(new Uri(url).GetLeftPart(UriPartial.Path));
+ }
+
+ // Throw if we still can't determine the content type
+ if (string.IsNullOrEmpty(contentType))
+ {
throw new HttpRequestException("Invalid image received: contentType not set.", null, response.StatusCode);
}
}