mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-02 21:24:15 -04:00
Fix the test
This commit is contained in:
parent
7576824cee
commit
cb173d79e6
@ -173,10 +173,5 @@ namespace Jellyfin.Api.Helpers
|
|||||||
.Select(i => i!.Value)
|
.Select(i => i!.Value)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static IPAddress NormalizeIp(IPAddress ip)
|
|
||||||
{
|
|
||||||
return ip.IsIPv4MappedToIPv6 ? ip.MapToIPv4() : ip;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
using System.Net;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
|
||||||
namespace MediaBrowser.Common.Extensions
|
namespace MediaBrowser.Common.Extensions
|
||||||
@ -26,7 +27,8 @@ namespace MediaBrowser.Common.Extensions
|
|||||||
/// <returns>The remote caller IP address.</returns>
|
/// <returns>The remote caller IP address.</returns>
|
||||||
public static string GetNormalizedRemoteIp(this HttpContext context)
|
public static string GetNormalizedRemoteIp(this HttpContext context)
|
||||||
{
|
{
|
||||||
var ip = context.Connection.RemoteIpAddress;
|
// Default to the loopback address if no RemoteIpAddress is specified (i.e. during integration tests)
|
||||||
|
var ip = context.Connection.RemoteIpAddress ?? IPAddress.Loopback;
|
||||||
|
|
||||||
if (ip.IsIPv4MappedToIPv6)
|
if (ip.IsIPv4MappedToIPv6)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user