Skip to content
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

Valid but invalid url #59

Closed
Tijs-2 opened this issue Apr 8, 2020 · 6 comments · Fixed by #62
Closed

Valid but invalid url #59

Tijs-2 opened this issue Apr 8, 2020 · 6 comments · Fixed by #62
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Tijs-2
Copy link

Tijs-2 commented Apr 8, 2020

Hi,

I am using your library and I think I found a bug with an url I found on the internet.

To reproduce it I do this:
from validator_collection import checkers print(checkers.is_url("http://www.test.com]"))

And then it says True, but I think it should return False

Kind regrards,
Tijs

@insightindustry insightindustry self-assigned this Apr 9, 2020
@insightindustry insightindustry added the wontfix This will not be worked on label Apr 9, 2020
@insightindustry
Copy link
Owner

Returning True for www.test.com is actually compliant with RFC 6761. As the RFC states for all *.test.* URLs:

  1. Application software SHOULD NOT recognize test names as special, and SHOULD use test names as they would other domain names.

  2. Name resolution APIs and libraries SHOULD NOT recognize test names as special and SHOULD NOT treat them differently. Name resolution APIs SHOULD send queries for test names to their configured caching DNS server(s).

@Tijs-2
Copy link
Author

Tijs-2 commented Apr 9, 2020

I think you misread the issue. The issue is not with the test.com because you can replace that with example.com or whatever domain but with the "]" at the end.

If you add one or multiple of them at the end like this the url stays valid:
"http://www.exaple.com]]]]/bla"

But maybe it is a valid char for a domain name, but I thought it was not allowed as part of the domain name.

@insightindustry insightindustry added bug Something isn't working and removed wontfix This will not be worked on labels Apr 9, 2020
@insightindustry
Copy link
Owner

Whoops! Sorry about that, you're absolutely right. I misread the issue and failed to catch the closing square-bracket on the end of the URL. Sorry about that. I'm reopening and will take a look.

@Tijs-2
Copy link
Author

Tijs-2 commented Apr 9, 2020

No problem, glad that I was not mistaken about the character :)

@insightindustry
Copy link
Owner

And yep - this is definitely a bug. The square-bracket is an unsafe character that is not supported in a URL, and it seems that the code is letting it slip through. I'll fix the bug in the next release (I probably won't have a chance to get to it until this weekend, though).

@insightindustry insightindustry added this to the v.1.4.2 milestone Apr 9, 2020
@Tijs-2
Copy link
Author

Tijs-2 commented Jun 2, 2020

I was wondering when the new release with the fix for this issue will be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants