-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool
Milestone
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
affected-very-fewThis issue impacts very few customersThis issue impacts very few customersapi-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issueseverity-nice-to-haveThis label is used by an internal toolThis label is used by an internal tool