mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 22:17:25 -04:00
Don't call tostring twice
This commit is contained in:
parent
e337756428
commit
bde8c00306
1 changed files with 3 additions and 2 deletions
|
@ -28,9 +28,10 @@ namespace MediaBrowser.Common.Extensions
|
|||
/// <returns>The remote caller IP address.</returns>
|
||||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue