mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #4671 from cvium/allow_proxy
Clear KnownNetworks and KnownProxies if none are configured explicitly (cherry picked from commit 804dd00425687ed099dc35c73a6ac6cf2077cc7d) Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
parent
2647935b96
commit
0b6a05cf82
@ -169,6 +169,13 @@ namespace Jellyfin.Server.Extensions
|
||||
.Configure<ForwardedHeadersOptions>(options =>
|
||||
{
|
||||
options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
|
||||
if (knownProxies.Count == 0)
|
||||
{
|
||||
options.KnownNetworks.Clear();
|
||||
options.KnownProxies.Clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
for (var i = 0; i < knownProxies.Count; i++)
|
||||
{
|
||||
if (IPAddress.TryParse(knownProxies[i], out var address))
|
||||
@ -176,6 +183,7 @@ namespace Jellyfin.Server.Extensions
|
||||
options.KnownProxies.Add(address);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.AddMvc(opts =>
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user