The Free Software Media System - Server Backend & API
Fix incorrect responses for HEAD /audio/<id>/stream
Szymon Acedański136136dea953
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.csindex f828b1d9d6..a567fce1e4 100644--- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs+++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs@@ -46,7 +46,8 @@ namespace Jellyfin.Api.Helpersif (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);@@ -71,7 +72,7 @@ namespace Jellyfin.Api.Helpers// if the request is a head request, return a NoContent result with the same headers as it would with a GET requestif (isHeadRequest){- return new NoContentResult();+ return new OkResult();}return new PhysicalFileResult(path, contentType) { EnableRangeProcessing = true };