diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-04-28 20:21:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-28 20:21:07 +0200 |
| commit | b733857da2c2061eb46fa52182f033fb245d1c42 (patch) | |
| tree | 0421dc4726e7a88dc6dff769d0f1b5288cb0eecd | |
| parent | 44a5c6b3dd20cab56f21349cbb9549ac8cf68449 (diff) | |
| parent | 9962fbbe2ed20a95dd1e9533fbc684070347f031 (diff) | |
Merge pull request #16672 from dwandw/fix-ipv6-prefixes-not-recognized-as-proxy
Fix IPv6 prefixes not recognized as proxy
| -rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
| -rw-r--r-- | Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs | 2 | ||||
| -rw-r--r-- | tests/Jellyfin.Server.Tests/ParseNetworkTests.cs | 16 |
3 files changed, 10 insertions, 9 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index eb2221f2b3..c42962786d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -228,6 +228,7 @@ - [MarcoCoreDuo](https://github.com/MarcoCoreDuo) - [LiHRaM](https://github.com/LiHRaM) - [MSalman5230](https://github.com/MSalman5230) + - [dwandw](https://github.com/dwandw) # Emby Contributors diff --git a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs index c71c193e2e..a498901481 100644 --- a/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs +++ b/Jellyfin.Server/Extensions/ApiServiceCollectionExtensions.cs @@ -312,7 +312,7 @@ namespace Jellyfin.Server.Extensions return; } - if (prefixLength == NetworkConstants.MinimumIPv4PrefixSize) + if ((addr.AddressFamily == AddressFamily.InterNetwork && prefixLength == NetworkConstants.MinimumIPv4PrefixSize) || (addr.AddressFamily == AddressFamily.InterNetworkV6 && prefixLength == NetworkConstants.MinimumIPv6PrefixSize)) { options.KnownProxies.Add(addr); } diff --git a/tests/Jellyfin.Server.Tests/ParseNetworkTests.cs b/tests/Jellyfin.Server.Tests/ParseNetworkTests.cs index 14f4c33b6b..e788f43b86 100644 --- a/tests/Jellyfin.Server.Tests/ParseNetworkTests.cs +++ b/tests/Jellyfin.Server.Tests/ParseNetworkTests.cs @@ -23,8 +23,8 @@ namespace Jellyfin.Server.Tests true, true, new string[] { "192.168.t", "127.0.0.1", "::1", "1234.1232.12.1234" }, - new IPAddress[] { IPAddress.Loopback }, - new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); + new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback }, + Array.Empty<IPNetwork>()); data.Add( true, @@ -37,8 +37,8 @@ namespace Jellyfin.Server.Tests true, true, new string[] { "::1" }, - Array.Empty<IPAddress>(), - new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); + new IPAddress[] { IPAddress.IPv6Loopback }, + Array.Empty<IPNetwork>()); data.Add( false, @@ -58,15 +58,15 @@ namespace Jellyfin.Server.Tests false, true, new string[] { "localhost" }, - Array.Empty<IPAddress>(), - new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); + new IPAddress[] { IPAddress.IPv6Loopback }, + Array.Empty<IPNetwork>()); data.Add( true, true, new string[] { "localhost" }, - new IPAddress[] { IPAddress.Loopback }, - new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); + new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback }, + Array.Empty<IPNetwork>()); return data; } |
