Skip to content

Conversation

@K3VRAL
Copy link

@K3VRAL K3VRAL commented May 9, 2022

Hello! I've noticed that I had some errors when getting a URL with a hostname that has an underscore, so I thought of finding and making some changes to the code such that URLs with an underscore in the hostname will now be valid, example:
https://_this_is_an.example.com

I was unable to test with the testing folder of the project, mainly because I don't really know how either because there is no documentation or I am looking in the wrong areas, or I lack experience with python testing with how this project is structured. I did use my own method of testing (using grep and the -P argument) and the results worked in the favor I was intending for, so hopefully it works in the code as well.

I was also inspired that this issue has already been hinted at but not fixed.

Closes #102
Closes #180
Maybe closes #38
And maybe something should happen to #179

K3VRAL and others added 3 commits May 9, 2022 15:24
After more testing and reading online where underscores can be legal in which parts of the URL, I found that underscores can be legal in the beginning of the subdomain which my code did not reflect correctly according to https://stackoverflow.com/questions/2180465/can-domain-name-subdomains-have-an-underscore-in-it.
I forgot to remove the conditional character while it was inside the "many of" characters.
@K3VRAL
Copy link
Author

K3VRAL commented May 10, 2022

One issue I currently am seeing right now and might need some time to be processed before anything should happen is that subdomains don't get the correct treatment with the underscores, such as:
https://_this._is._an.example.com

I'll need to do more testing before doing anything with this pull request.

@K3VRAL K3VRAL closed this May 10, 2022
@h4knet
Copy link

h4knet commented May 25, 2022

I confirm I have the same problem. I was about to open an issue.. Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URLs Fail Validation Underscores in URLs seem to break the validator validators.url Internationalisation validation fail

2 participants