Repository: dotnet/aspnetcore
File: src/Middleware/HttpOverrides/src/ForwardedHeadersOptions.cs (C#)

Code before:
    /// </summary>
    /// <seealso cref="ForwardedHeadersDefaults"/>
    public string OriginalPrefixHeaderName { get; set; } = ForwardedHeadersDefaults.XOriginalPrefixHeaderName;

    /// <summary>
    /// Identifies which forwarders should be processed.
    /// </summary>
    public ForwardedHeaders ForwardedHeaders { get; set; }

    /// <summary>
    /// Limits the number of entries in the headers that will be processed. The default value is 1.
    /// Set to null to disable the limit, but this should only be done if
    /// KnownProxies or KnownNetworks are configured.
    /// </summary>
    public int? ForwardLimit { get; set; } = 1;

    /// <summary>
    /// Addresses of known proxies to accept forwarded headers from.
    /// </summary>
    public IList<IPAddress> KnownProxies { get; } = new List<IPAddress>() { IPAddress.IPv6Loopback };

    /// <summary>
    /// Address ranges of known proxies to accept forwarded headers from.
    /// Obsolete, please use <see cref="KnownIPNetworks"/> instead
    /// </summary>
    [Obsolete("Please use KnownIPNetworks instead")]
    public IList<AspNetIPNetwork> KnownNetworks { get; } = new List<AspNetIPNetwork>() { new(IPAddress.Loopback, 8) };

    /// <summary>
    /// Address ranges of known proxies to accept forwarded headers from.
    /// </summary>
    public IList<IPNetwork> KnownIPNetworks { get; } = new List<IPNetwork>() { new(IPAddress.Loopback, 8) };

    /// <summary>
    /// The allowed values from x-forwarded-host. If the list is empty then all hosts are allowed.
    /// Failing to restrict this these values may allow an attacker to spoof links generated by your service.
    /// </summary>
    /// <remarks>
    /// <list type="bullet">
    /// <item><description>Port numbers must be excluded.</description></item>
    /// <item><description>A top level wildcard "*" allows all non-empty hosts.</description></item>
    /// <item><description>Subdomain wildcards are permitted. E.g. "*.example.com" matches subdomains like foo.example.com,
    ///    but not the parent domain example.com.</description></item>
    /// <item><description>Unicode host names are allowed but will be converted to punycode for matching.</description></item>
    /// <item><description>IPv6 addresses must include their bounding brackets and be in their normalized form.</description></item>
    /// </list>
    /// </remarks>
    public IList<string> AllowedHosts { get; set; } = new List<string>();

    /// <summary>
    /// Require the number of header values to be in sync between the different headers being processed.

Review comment (suggestion):
We're trying to align some of our obsoletion messages, could we update these to:
`[Obsolete("Please use KnownIPNetworks instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005")]`

That also means we'll need to update the pragma warnings to use ASPDEPR005.

Code after:
    /// </summary>
    /// <seealso cref="ForwardedHeadersDefaults"/>
    public string OriginalPrefixHeaderName { get; set; } = ForwardedHeadersDefaults.XOriginalPrefixHeaderName;

    /// <summary>
    /// Identifies which forwarders should be processed.
    /// </summary>
    public ForwardedHeaders ForwardedHeaders { get; set; }

    /// <summary>
    /// Limits the number of entries in the headers that will be processed. The default value is 1.
    /// Set to null to disable the limit, but this should only be done if
    /// KnownProxies or KnownNetworks are configured.
    /// </summary>
    public int? ForwardLimit { get; set; } = 1;

    /// <summary>
    /// Addresses of known proxies to accept forwarded headers from.
    /// </summary>
    public IList<IPAddress> KnownProxies { get; } = new List<IPAddress>() { IPAddress.IPv6Loopback };

    /// <summary>
    /// Address ranges of known proxies to accept forwarded headers from.
    /// Obsolete, please use <see cref="KnownIPNetworks"/> instead
    /// </summary>
    [Obsolete("Please use KnownIPNetworks instead. For more information, visit https://aka.ms/aspnet/deprecate/005.", DiagnosticId = "ASPDEPR005")]
    public IList<AspNetIPNetwork> KnownNetworks { get; } = new List<AspNetIPNetwork>() { new(IPAddress.Loopback, 8) };

    /// <summary>
    /// Address ranges of known proxies to accept forwarded headers from.
    /// </summary>
    public IList<IPNetwork> KnownIPNetworks { get; } = new List<IPNetwork>() { new(IPAddress.Loopback, 8) };

    /// <summary>
    /// The allowed values from x-forwarded-host. If the list is empty then all hosts are allowed.
    /// Failing to restrict this these values may allow an attacker to spoof links generated by your service.
    /// </summary>
    /// <remarks>
    /// <list type="bullet">
    /// <item><description>Port numbers must be excluded.</description></item>
    /// <item><description>A top level wildcard "*" allows all non-empty hosts.</description></item>
    /// <item><description>Subdomain wildcards are permitted. E.g. "*.example.com" matches subdomains like foo.example.com,
    ///    but not the parent domain example.com.</description></item>
    /// <item><description>Unicode host names are allowed but will be converted to punycode for matching.</description></item>
    /// <item><description>IPv6 addresses must include their bounding brackets and be in their normalized form.</description></item>
    /// </list>
    /// </remarks>
    public IList<string> AllowedHosts { get; set; } = new List<string>();

    /// <summary>
    /// Require the number of header values to be in sync between the different headers being processed.