-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Fix validation for single level domains #43876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This looks strange to me because this means that |
@nicolas-grekas wasn't this case fixed by #44119? |
#44119 is on HttpClient+Mime, this one is on Validator, so I'm not sure. |
Yes you are right, at the Validator level maybe we don't have to worry about the |
@nicolas-grekas Sorry, I missed your earlier comment, will check it out later today. |
Looks like #44252 could provide us with another test case, can you please incorporate it here also? |
829372b
to
6dc7c87
Compare
I've split the domain part into two cases:
Of course, this won't work if you have a multi-level internal domain, eg |
6dc7c87
to
4d3c016
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've update the regexp to not allow unicode chars in local domain names
I've also split it to deal with punycode separately from unicode global domain names,
and ensured that http://বিডিআইএ.বাংলা
is accepted (adding \pM
to the regexp) for unicode global domain names, since this host exists.
8b29f2c
to
5cbd90e
Compare
5cbd90e
to
653a21d
Compare
Thank you @HypeMC. |
Not sure if there are any other test cases that could be added, but this seems to fix the problem.