Opened 3 years ago
Last modified 3 years ago
#32874 closed New feature
URLValidator is not validating schema relative URLs — at Initial Version
Reported by: | Maciej Strömich | Owned by: | nobody |
---|---|---|---|
Component: | Core (Other) | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Based on rfc1808#section-2.4.3 a valid schema relative URL is the one starting with //
URLValidator is not validating such urls.
`
from django.core.validators import URLValidator
value = 'example.com'
URLValidator().call(value)
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/opt/venv/lib/python3.8/site-packages/django/core/validators.py", line 110, in call
raise ValidationError(self.message, code=self.code, params={'value': value})
django.core.exceptions.ValidationError: Enter a valid URL.
`