#32874: URLValidator is not validating schema relative URLs
------------------------------------------+------------------------
               Reporter:  maciejstromich  |          Owner:  nobody
                   Type:  Bug             |         Status:  new
              Component:  Uncategorized   |        Version:  3.2
               Severity:  Normal          |       Keywords:
           Triage Stage:  Unreviewed      |      Has patch:  0
    Needs documentation:  0               |    Needs tests:  0
Patch needs improvement:  0               |  Easy pickings:  0
                  UI/UX:  0               |
------------------------------------------+------------------------
 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.']
 ```

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32874>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/057.5954a2981e4f84c8e57c6a1dda4459e7%40djangoproject.com.

Reply via email to