diff options
| author | oledfish <88390729+oledfish@users.noreply.github.com> | 2022-01-16 21:33:18 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-16 21:33:18 -0300 |
| commit | 3b075a58027be4a2a3bdf662c70934f6cafafe87 (patch) | |
| tree | b4c226f25f843c3f2685c92e1edc3b3999716d34 /Jellyfin.Api/Controllers/DlnaServerController.cs | |
| parent | 86a5e72a65df638df2cde349ccd2ad8c5d40f88c (diff) | |
| parent | ef0708d876434a99ec647473c37295fab45a35fb (diff) | |
Merge branch 'jellyfin:master' into additional-episode-orders
Diffstat (limited to 'Jellyfin.Api/Controllers/DlnaServerController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/DlnaServerController.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Jellyfin.Api/Controllers/DlnaServerController.cs b/Jellyfin.Api/Controllers/DlnaServerController.cs index 694d16ad9..b1c576c33 100644 --- a/Jellyfin.Api/Controllers/DlnaServerController.cs +++ b/Jellyfin.Api/Controllers/DlnaServerController.cs @@ -7,7 +7,10 @@ using System.Threading.Tasks; using Emby.Dlna; using Emby.Dlna.Main; using Jellyfin.Api.Attributes; +using Jellyfin.Api.Constants; using MediaBrowser.Controller.Dlna; +using MediaBrowser.Model.Net; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -17,6 +20,7 @@ namespace Jellyfin.Api.Controllers /// Dlna Server Controller. /// </summary> [Route("Dlna")] + [Authorize(Policy = Policies.AnonymousLanAccessPolicy)] public class DlnaServerController : BaseJellyfinApiController { private readonly IDlnaManager _dlnaManager; @@ -334,11 +338,7 @@ namespace Jellyfin.Api.Controllers return NotFound(); } - var contentType = "image/" + Path.GetExtension(fileName) - .TrimStart('.') - .ToLowerInvariant(); - - return File(icon.Stream, contentType); + return File(icon.Stream, MimeTypes.GetMimeType(fileName)); } private string GetAbsoluteUri() |
