Merge pull request #16672 from dwandw/fix-ipv6-prefixes-not-recognized-as-proxy
Some checks failed
Stale PR Check / Check PRs with merge conflicts (push) Has been cancelled
CodeQL / Analyze (csharp) (push) Has been cancelled
Tests / run-tests (macos-latest) (push) Has been cancelled
Tests / run-tests (ubuntu-latest) (push) Has been cancelled
Tests / run-tests (windows-latest) (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Artifact (push) Has been cancelled
Project Automation / Project board (push) Has been cancelled
Merge Conflict Labeler / Labeling (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Unstable Spec (push) Has been cancelled
OpenAPI Publish / OpenAPI - Publish Stable Spec (push) Has been cancelled
Stale Issue Labeler / Check for stale issues (push) Has been cancelled

Fix IPv6 prefixes not recognized as proxy
This commit is contained in:
Bond-009
2026-04-28 20:21:07 +02:00
committed by GitHub
3 changed files with 10 additions and 9 deletions

View File

@@ -228,6 +228,7 @@
- [MarcoCoreDuo](https://github.com/MarcoCoreDuo) - [MarcoCoreDuo](https://github.com/MarcoCoreDuo)
- [LiHRaM](https://github.com/LiHRaM) - [LiHRaM](https://github.com/LiHRaM)
- [MSalman5230](https://github.com/MSalman5230) - [MSalman5230](https://github.com/MSalman5230)
- [dwandw](https://github.com/dwandw)
# Emby Contributors # Emby Contributors

View File

@@ -312,7 +312,7 @@ namespace Jellyfin.Server.Extensions
return; return;
} }
if (prefixLength == NetworkConstants.MinimumIPv4PrefixSize) if ((addr.AddressFamily == AddressFamily.InterNetwork && prefixLength == NetworkConstants.MinimumIPv4PrefixSize) || (addr.AddressFamily == AddressFamily.InterNetworkV6 && prefixLength == NetworkConstants.MinimumIPv6PrefixSize))
{ {
options.KnownProxies.Add(addr); options.KnownProxies.Add(addr);
} }

View File

@@ -23,8 +23,8 @@ namespace Jellyfin.Server.Tests
true, true,
true, true,
new string[] { "192.168.t", "127.0.0.1", "::1", "1234.1232.12.1234" }, new string[] { "192.168.t", "127.0.0.1", "::1", "1234.1232.12.1234" },
new IPAddress[] { IPAddress.Loopback }, new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); Array.Empty<IPNetwork>());
data.Add( data.Add(
true, true,
@@ -37,8 +37,8 @@ namespace Jellyfin.Server.Tests
true, true,
true, true,
new string[] { "::1" }, new string[] { "::1" },
Array.Empty<IPAddress>(), new IPAddress[] { IPAddress.IPv6Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); Array.Empty<IPNetwork>());
data.Add( data.Add(
false, false,
@@ -58,15 +58,15 @@ namespace Jellyfin.Server.Tests
false, false,
true, true,
new string[] { "localhost" }, new string[] { "localhost" },
Array.Empty<IPAddress>(), new IPAddress[] { IPAddress.IPv6Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); Array.Empty<IPNetwork>());
data.Add( data.Add(
true, true,
true, true,
new string[] { "localhost" }, new string[] { "localhost" },
new IPAddress[] { IPAddress.Loopback }, new IPAddress[] { IPAddress.Loopback, IPAddress.IPv6Loopback },
new IPNetwork[] { new IPNetwork(IPAddress.IPv6Loopback, 128) }); Array.Empty<IPNetwork>());
return data; return data;
} }