mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-20 15:55:25 +03:00
Remove conversion from IPAddress to string to IPAddress
This commit is contained in:
@@ -25,7 +25,7 @@ namespace MediaBrowser.Common.Extensions
|
||||
/// </summary>
|
||||
/// <param name="context">The HTTP context.</param>
|
||||
/// <returns>The remote caller IP address.</returns>
|
||||
public static string GetNormalizedRemoteIp(this HttpContext context)
|
||||
public static IPAddress GetNormalizedRemoteIp(this HttpContext context)
|
||||
{
|
||||
// Default to the loopback address if no RemoteIpAddress is specified (i.e. during integration tests)
|
||||
var ip = context.Connection.RemoteIpAddress ?? IPAddress.Loopback;
|
||||
@@ -35,7 +35,7 @@ namespace MediaBrowser.Common.Extensions
|
||||
ip = ip.MapToIPv4();
|
||||
}
|
||||
|
||||
return ip.ToString();
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user