Merge pull request #4671 from cvium/allow_proxy
Clear KnownNetworks and KnownProxies if none are configured explicitly
This commit is contained in:
commit
804dd00425
|
@ -169,11 +169,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 New Issue
Block a user