Remove special HTTP HEAD processing
removing this allows HTTP 206 Partial Content responses and lets some clients(popcorn hour namely) play videos from JF.
This commit is contained in:
parent
565ebbb643
commit
bd2bec4d4a
|
@ -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);
|
return PhysicalFile(imagePath, imageContentType ?? MediaTypeNames.Text.Plain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,12 +45,6 @@ namespace Jellyfin.Api.Helpers
|
||||||
|
|
||||||
httpContext.Response.Headers[HeaderNames.AcceptRanges] = "none";
|
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);
|
return new FileStreamResult(await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false), contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,12 +64,6 @@ namespace Jellyfin.Api.Helpers
|
||||||
{
|
{
|
||||||
httpContext.Response.ContentType = contentType;
|
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 };
|
return new PhysicalFileResult(path, contentType) { EnableRangeProcessing = true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user