mirror of
https://github.com/jellyfin/jellyfin
synced 2024-09-06 08:04:44 +00:00
Clear KnownNetworks and KnownProxies if none are configured explicitly
This commit is contained in:
parent
4a3411cad1
commit
41cd4d0a39
|
@ -152,11 +152,19 @@ namespace Jellyfin.Server.Extensions
|
|||
.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
for (var i = 0; i < knownProxies.Count; i++)
|
||||
if (knownProxies.Count == 0)
|
||||
{
|
||||
if (IPAddress.TryParse(knownProxies[i], out var address))
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < knownProxies.Count; i++)
|
||||
{
|
||||
options.KnownProxies.Add(address);
|
||||
if (IPAddress.TryParse(knownProxies[i], out var address))
|
||||
{
|
||||
options.KnownProxies.Add(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue