aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-09-25 19:21:37 +0200
committerGitHub <noreply@github.com>2021-09-25 19:21:37 +0200
commit2ee3e9e00f62ff8b0139f1273d7666d0f6c549a4 (patch)
tree354f808d6687abcd3b5f862c0cb8c9e4fd754966 /Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
parentd81c9a7a8cbab8967bfc66086c6f0f80bf7fc0c2 (diff)
parent4643fd5dcbc6d1a4fbe973efc68d92ca71e3ab3b (diff)
Merge pull request #6590 from jellyfin/dotnet6
Diffstat (limited to 'Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs')
-rw-r--r--Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
index b0fd59e5e..6385b62c9 100644
--- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
+++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Net.Http;
+using System.Net.Mime;
using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Models.PlaybackDtos;
@@ -40,7 +41,7 @@ namespace Jellyfin.Api.Helpers
// Can't dispose the response as it's required up the call chain.
var response = await httpClient.GetAsync(new Uri(state.MediaPath), cancellationToken).ConfigureAwait(false);
- var contentType = response.Content.Headers.ContentType?.ToString();
+ var contentType = response.Content.Headers.ContentType?.ToString() ?? MediaTypeNames.Text.Plain;
httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none";