diff options
| author | crobibero <cody@robibe.ro> | 2020-09-09 14:23:53 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-09 14:23:53 -0600 |
| commit | efce4d4bf3667dbf4e130118e26f5c5c0775ca21 (patch) | |
| tree | b8eb0131c700b5a07458135a46c0453f8d767107 /Jellyfin.Api/Controllers/SystemController.cs | |
| parent | 8e15142d82b8f279e7efeb873491fff7f60a881f (diff) | |
| parent | 621f3b705052f628e27fb975a8bb809853742ad8 (diff) | |
Merge remote-tracking branch 'upstream/master' into bad-route
Diffstat (limited to 'Jellyfin.Api/Controllers/SystemController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/SystemController.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs index bbfd163de..e878e8f36 100644 --- a/Jellyfin.Api/Controllers/SystemController.cs +++ b/Jellyfin.Api/Controllers/SystemController.cs @@ -3,8 +3,10 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; +using System.Net.Mime; using System.Threading; using System.Threading.Tasks; +using Jellyfin.Api.Attributes; using Jellyfin.Api.Constants; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; @@ -190,6 +192,7 @@ namespace Jellyfin.Api.Controllers [HttpGet("Logs/Log")] [Authorize(Policy = Policies.RequiresElevation)] [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesFile(MediaTypeNames.Text.Plain)] public ActionResult GetLogFile([FromQuery, Required] string? name) { var file = _fileSystem.GetFiles(_appPaths.LogDirectoryPath) @@ -197,7 +200,6 @@ namespace Jellyfin.Api.Controllers // For older files, assume fully static var fileShare = file.LastWriteTimeUtc < DateTime.UtcNow.AddHours(-1) ? FileShare.Read : FileShare.ReadWrite; - FileStream stream = new FileStream(file.FullName, FileMode.Open, FileAccess.Read, fileShare); return File(stream, "text/plain"); } |
