mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Don't call tostring twice
This commit is contained in:
parent
e337756428
commit
bde8c00306
@ -28,9 +28,10 @@ namespace MediaBrowser.Common.Extensions
|
|||||||
/// <returns>The remote caller IP address.</returns>
|
/// <returns>The remote caller IP address.</returns>
|
||||||
public static string RemoteIp(this HttpRequest request)
|
public static string RemoteIp(this HttpRequest request)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(request.HttpContext.Items["RemoteIp"].ToString()))
|
var cachedRemoteIp = request.HttpContext.Items["RemoteIp"].ToString();
|
||||||
|
if (string.IsNullOrEmpty(cachedRemoteIp))
|
||||||
{
|
{
|
||||||
return request.HttpContext.Items["RemoteIp"].ToString();
|
return cachedRemoteIp;
|
||||||
}
|
}
|
||||||
|
|
||||||
IPAddress ip;
|
IPAddress ip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user