Skip to content

System.Net.IPNetwork not behave as Microsoft.AspNetCore.HttpOverrides.IPNetwork #117114

Open
@WeihanLi

Description

@WeihanLi

Description

When trying to use System.Net.IPNetwork to replace Microsoft.AspNetCore.HttpOverrides.IPNetwork, find that's not exactly the same

Reproduction Steps

sample

using AspIPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;
using IPNetwork = System.Net.IPNetwork;

Console.WriteLine(AspIPNetwork.TryParse("127.0.0.1/8", out _));
Console.WriteLine(IPNetwork.TryParse("127.0.0.1/8", out _));

Expected behavior

output true for both

Image

https://cidr.xyz/#127.0.0.1/8

Actual behavior

output true for Microsoft.AspNetCore.HttpOverrides.IPNetwork
but false for System.Net.IPNetwork

Regression?

No response

Known Workarounds

No response

Configuration

.NET 10 Preview 5

Other information

similar to #95321

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.NetenhancementProduct code improvement that does NOT require public API changes/additionsgood first issueIssue should be easy to implement, good for first-time contributorshelp wanted[up-for-grabs] Good issue for external contributors

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions