You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has this caused you issues in practice, or is it more just something odd that you've noticed?
Given other issues around the kind of hostname validation we do (#64707), I wouldn't be surprised if we go in the other direction and be less restrictive instead.
I was looking for an API that allows me to check whether a string provided by the user is a valid IPv4/IPv6/domain name. Uri.CheckHostName seemed like a good fit.
When trying some strings, it didn't behave as I had expected for 300.300.300.300, so I reported this issue.
Given other issues around the kind of hostname validation we do (#64707), I wouldn't be surprised if we go in the other direction and be less restrictive instead.
This makes sense.
Perhaps there is some room to consider how Uri.CheckHostName behaves with these changes. May be UriHostNameType.Basic could be returned for non valid domain names (though valid per URI RFCs).
doesn't throw and is considered a valid DNS name by the
Uri
class.This is because it meets the criteria of a valid domain name, due to dropping the requirement for the first character to be alphabetic:
runtime/src/libraries/System.Private.Uri/src/System/DomainNameHelper.cs
Lines 128 to 133 in 73bcb1d
Perhaps it would make sense to require at least one alphabetic character be present in each label?
The text was updated successfully, but these errors were encountered: