File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -46,5 +46,17 @@ public void Configure(ForwardedHeadersOptions options)
4646 // being enabled by explicit configuration.
4747 options . KnownNetworks . Clear ( ) ;
4848 options . KnownProxies . Clear ( ) ;
49+
50+ var knownNetworks = _configuration [ "ForwardedHeaders_KnownNetworks" ] ? . Split ( ',' , StringSplitOptions . RemoveEmptyEntries | StringSplitOptions . TrimEntries ) ?? [ ] ;
51+ foreach ( var network in knownNetworks )
52+ {
53+ options . KnownNetworks . Add ( IPNetwork . Parse ( network ) ) ;
54+ }
55+
56+ var knownProxy = _configuration [ "ForwardedHeaders_KnownProxies" ] ? . Split ( ',' , StringSplitOptions . RemoveEmptyEntries | StringSplitOptions . TrimEntries ) ?? [ ] ;
57+ foreach ( var network in knownNetworks )
58+ {
59+ options . KnownNetworks . Add ( IPAddress . Parse ( network ) ) ;
60+ }
4961 }
5062}
You can’t perform that action at this time.
0 commit comments