diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2021-03-24 23:04:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-24 23:04:28 +0100 |
| commit | e64f9f2f66bca134bba040709a44b43dba4afcd1 (patch) | |
| tree | 3cb3800934726d5c37b8e9726f5540ae65f6e708 /Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs | |
| parent | 8410a9a26601d754e3c8bed36641c990f1d0e22b (diff) | |
| parent | b1e8a8565f316e9b3d65b3a681384dfc8d743b98 (diff) | |
Merge pull request #5613 from accek/accek-samsung-dlna-fix
Diffstat (limited to 'Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs index f828b1d9d..b0fd59e5e 100644 --- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs +++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs @@ -46,7 +46,8 @@ namespace Jellyfin.Api.Helpers if (isHeadRequest) { - return new FileContentResult(Array.Empty<byte>(), contentType); + httpContext.Response.Headers[HeaderNames.ContentType] = contentType; + return new OkResult(); } return new FileStreamResult(await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false), contentType); @@ -68,10 +69,10 @@ namespace Jellyfin.Api.Helpers { httpContext.Response.ContentType = contentType; - // if the request is a head request, return a NoContent result with the same headers as it would with a GET request + // if the request is a head request, return an OkResult (200) with the same headers as it would with a GET request if (isHeadRequest) { - return new NoContentResult(); + return new OkResult(); } return new PhysicalFileResult(path, contentType) { EnableRangeProcessing = true }; |
