-
Notifications
You must be signed in to change notification settings - Fork 163
Closed
Labels
bugIssue: Works not as designedIssue: Works not as designedoutdatedIssue/PR: Open for more than 3 monthsIssue/PR: Open for more than 3 months
Description
URL validator fails when validating urls with one digit port
>>> validators.url("http://google.com/test")
True
>>> validators.url("http://google.com:80/test")
True
>>> validators.url("http://google.com:10/test")
True
>>> validators.url("http://google.com:9/test")
ValidationFailure(func=url, args={'public': False, 'value': 'http://google.com:9/test'})
>>> validators.url("http://google.com:8/test")
ValidationFailure(func=url, args={'public': False, 'value': 'http://google.com:8/test'})
>>> validators.url("http://google.com:7/test")
ValidationFailure(func=url, args={'public': False, 'value': 'http://google.com:7/test'})
>>> validators.url("http://google.com:2/test")
ValidationFailure(func=url, args={'public': False, 'value': 'http://google.com:2/test'})
>>> validators.url("http://google.com:1/test")
ValidationFailure(func=url, args={'public': False, 'value': 'http://google.com:1/test'})
I think the problem is in this line, forcing the port number having 2 to 5 digits
https://github.com/kvesteri/validators/blob/8cf1e8fb5ed3af3d428b0230c50d63d55dd0939a/validators/url.py#L45
CrimsonGlory
Metadata
Metadata
Assignees
Labels
bugIssue: Works not as designedIssue: Works not as designedoutdatedIssue/PR: Open for more than 3 monthsIssue/PR: Open for more than 3 months