aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/SystemController.cs
diff options
context:
space:
mode:
authorTommaso Stocchi <tommasostocchi@outlook.com>2021-06-03 17:15:32 +0200
committerGitHub <noreply@github.com>2021-06-03 17:15:32 +0200
commit2b232df07ff1e6b82005deb9e2797260fdd48b8b (patch)
treebafa3828f2299d8e2ff23faef415871d7818ad3a /Jellyfin.Api/Controllers/SystemController.cs
parentdc261b815f4ce5fbace33e787902636c43618881 (diff)
parentb060d9d0f1b3dac523288a3aaf182f7e35cf875c (diff)
Merge branch 'master' into bug/authorization-header-issue
Diffstat (limited to 'Jellyfin.Api/Controllers/SystemController.cs')
-rw-r--r--Jellyfin.Api/Controllers/SystemController.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs
index 7784e8a11..bbbe5fb8d 100644
--- a/Jellyfin.Api/Controllers/SystemController.cs
+++ b/Jellyfin.Api/Controllers/SystemController.cs
@@ -3,8 +3,8 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq;
+using System.Net;
using System.Net.Mime;
-using System.Threading;
using System.Threading.Tasks;
using Jellyfin.Api.Attributes;
using Jellyfin.Api.Constants;
@@ -66,7 +66,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<SystemInfo> GetSystemInfo()
{
- return _appHost.GetSystemInfo(Request.HttpContext.Connection.RemoteIpAddress);
+ return _appHost.GetSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback);
}
/// <summary>
@@ -78,7 +78,7 @@ namespace Jellyfin.Api.Controllers
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<PublicSystemInfo> GetPublicSystemInfo()
{
- return _appHost.GetPublicSystemInfo(Request.HttpContext.Connection.RemoteIpAddress);
+ return _appHost.GetPublicSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback);
}
/// <summary>
@@ -202,7 +202,7 @@ 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");
+ return File(stream, "text/plain; charset=utf-8");
}
/// <summary>