mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Set Content-Disposition header to attachment for image endpoints (#12490)
This commit is contained in:
parent
078ee1f2de
commit
9645955629
@ -2089,6 +2089,8 @@ public class ImageController : BaseJellyfinApiController
|
|||||||
Response.Headers.Append(HeaderNames.Age, Convert.ToInt64((DateTime.UtcNow - dateImageModified).TotalSeconds).ToString(CultureInfo.InvariantCulture));
|
Response.Headers.Append(HeaderNames.Age, Convert.ToInt64((DateTime.UtcNow - dateImageModified).TotalSeconds).ToString(CultureInfo.InvariantCulture));
|
||||||
Response.Headers.Append(HeaderNames.Vary, HeaderNames.Accept);
|
Response.Headers.Append(HeaderNames.Vary, HeaderNames.Accept);
|
||||||
|
|
||||||
|
Response.Headers.ContentDisposition = "attachment";
|
||||||
|
|
||||||
if (disableCaching)
|
if (disableCaching)
|
||||||
{
|
{
|
||||||
Response.Headers.Append(HeaderNames.CacheControl, "no-cache, no-store, must-revalidate");
|
Response.Headers.Append(HeaderNames.CacheControl, "no-cache, no-store, must-revalidate");
|
||||||
|
@ -233,6 +233,8 @@ public class PluginsController : BaseJellyfinApiController
|
|||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Response.Headers.ContentDisposition = "attachment";
|
||||||
|
|
||||||
imagePath = Path.Combine(plugin.Path, plugin.Manifest.ImagePath);
|
imagePath = Path.Combine(plugin.Path, plugin.Manifest.ImagePath);
|
||||||
return PhysicalFile(imagePath, MimeTypes.GetMimeType(imagePath));
|
return PhysicalFile(imagePath, MimeTypes.GetMimeType(imagePath));
|
||||||
}
|
}
|
||||||
|
@ -95,6 +95,7 @@ public class TrickplayController : BaseJellyfinApiController
|
|||||||
var path = _trickplayManager.GetTrickplayTilePath(item, width, index);
|
var path = _trickplayManager.GetTrickplayTilePath(item, width, index);
|
||||||
if (System.IO.File.Exists(path))
|
if (System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
|
Response.Headers.ContentDisposition = "attachment";
|
||||||
return PhysicalFile(path, MediaTypeNames.Image.Jpeg);
|
return PhysicalFile(path, MediaTypeNames.Image.Jpeg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user