Closed
Description
Is your feature request related to a problem? Please describe.
I've been reading a blog post by Jon Skeet and noticed this code in it:
options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("130.211.0.0"), 22));
I think that this code is quite verbose and it would be easier to understand if it would be possible to use IP subnet syntax here.
Describe the solution you'd like
A new method:
public class IPNetwork
{
public static IPNetwork Parse(string subnetString);
}
It could be used like this:
options.KnownNetworks.Add(IPNetwork.Parse("130.211.0.0/22")));
If this method was added, it would probably also make sense to add a Try
version of it:
public static bool TryParse(string subnetString, out IPNetwork network);
What do you think?
Metadata
Metadata
Assignees
Labels
This issue impacts very few customersAPI was approved in API review, it can be implementedIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresThis issue represents an ask for new feature or an enhancement to an existing oneUp for grabs. We would accept a PR to help resolve this issueThis label is used by an internal tool