Added localhost to known networks on UseProxyHosting()
This commit is contained in:
@@ -20,10 +20,14 @@ namespace Microsoft.AspNetCore.Builder
|
|||||||
/// <br/>
|
/// <br/>
|
||||||
/// Additionally you can specify the proxy server by using <paramref name="address"/> or a <paramref name="network"/> when there are multiple proxy servers.
|
/// Additionally you can specify the proxy server by using <paramref name="address"/> or a <paramref name="network"/> when there are multiple proxy servers.
|
||||||
/// <br/>
|
/// <br/>
|
||||||
/// When no <paramref name="address"/> oder <paramref name="network"/> is set, the default IPv4 private subnets are configured:<br/>
|
/// When no <paramref name="address"/> oder <paramref name="network"/> is set, the default subnets are configured:<br/>
|
||||||
|
/// - <c>127.0.0.0/8</c><br/>
|
||||||
/// - <c>10.0.0.0/8</c><br/>
|
/// - <c>10.0.0.0/8</c><br/>
|
||||||
/// - <c>172.16.0.0/12</c><br/>
|
/// - <c>172.16.0.0/12</c><br/>
|
||||||
/// - <c>192.168.0.0/16</c>
|
/// - <c>192.168.0.0/16</c><br/>
|
||||||
|
///
|
||||||
|
/// - <c>::1/128</c><br/>
|
||||||
|
/// - <c>fd00::/8</c>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="app">The application builder.</param>
|
/// <param name="app">The application builder.</param>
|
||||||
/// <param name="network">The <see cref="IPNetwork"/> where proxy requests are received from (optional).</param>
|
/// <param name="network">The <see cref="IPNetwork"/> where proxy requests are received from (optional).</param>
|
||||||
@@ -40,9 +44,17 @@ namespace Microsoft.AspNetCore.Builder
|
|||||||
|
|
||||||
if (network == null && address == null)
|
if (network == null && address == null)
|
||||||
{
|
{
|
||||||
|
// localhost
|
||||||
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("127.0.0.0"), 8));
|
||||||
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("::1"), 128));
|
||||||
|
|
||||||
|
// private IPv4 networks
|
||||||
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("10.0.0.0"), 8));
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("10.0.0.0"), 8));
|
||||||
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("172.16.0.0"), 12));
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("172.16.0.0"), 12));
|
||||||
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("192.168.0.0"), 16));
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("192.168.0.0"), 16));
|
||||||
|
|
||||||
|
// private IPv6 networks
|
||||||
|
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("fd00::"), 8));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (network != null)
|
if (network != null)
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Added `ConfigureAwait(false)` to async calls where appropriate
|
- Added `ConfigureAwait(false)` to async calls where appropriate
|
||||||
|
- Added localhost and private IPv6 subnet to `UseProxyHosting()`
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user