aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSenorSmartyPants <senorsmartypants@gmail.com>2022-01-07 16:29:22 -0600
committerSenorSmartyPants <senorsmartypants@gmail.com>2022-01-07 16:29:22 -0600
commitbd2bec4d4aedb1e39082d51abd75797eaf42b28a (patch)
tree41090454a9b14ff4fbea78e417960ca86216af3a
parent565ebbb643030f588077e9c28f13c8d9ec2afcce (diff)
Remove special HTTP HEAD processing
removing this allows HTTP 206 Partial Content responses and lets some clients(popcorn hour namely) play videos from JF.
-rw-r--r--Jellyfin.Api/Controllers/ImageController.cs6
-rw-r--r--Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs12
2 files changed, 0 insertions, 18 deletions
diff --git a/Jellyfin.Api/Controllers/ImageController.cs b/Jellyfin.Api/Controllers/ImageController.cs
index 86933074d..9ed9430cc 100644
--- a/Jellyfin.Api/Controllers/ImageController.cs
+++ b/Jellyfin.Api/Controllers/ImageController.cs
@@ -2020,12 +2020,6 @@ namespace Jellyfin.Api.Controllers
}
}
- // if the request is a head request, return a NoContent result with the same headers as it would with a GET request
- if (isHeadRequest)
- {
- return NoContent();
- }
-
return PhysicalFile(imagePath, imageContentType ?? MediaTypeNames.Text.Plain);
}
}
diff --git a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
index 6385b62c9..639bbb82e 100644
--- a/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
+++ b/Jellyfin.Api/Helpers/FileStreamResponseHelpers.cs
@@ -45,12 +45,6 @@ namespace Jellyfin.Api.Helpers
httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none";
- if (isHeadRequest)
- {
- httpContext.Response.Headers[HeaderNames.ContentType] = contentType;
- return new OkResult();
- }
-
return new FileStreamResult(await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false), contentType);
}
@@ -70,12 +64,6 @@ namespace Jellyfin.Api.Helpers
{
httpContext.Response.ContentType = contentType;
- // 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 OkResult();
- }
-
return new PhysicalFileResult(path, contentType) { EnableRangeProcessing = true };
}