#32298: django.core.validators.URLValidator tests netloc instead of hostname for
length
-----------------------------------------+------------------------
               Reporter:  zt_initech     |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  new
              Component:  Uncategorized  |        Version:  3.1
               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              |
-----------------------------------------+------------------------
 This code:
 https://github.com/django/django/blob/master/django/core/validators.py#L141

 urlparse:
 https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse

 In case of url like
 {{{
 urlparse('https://username1:[email protected]/foo')
 }}}

 the parse result is:
 {{{
  ParseResult(scheme='https', netloc='username1:[email protected]',
 path='/foo', params='', query='', fragment='')
 }}}

 with the username and password in netloc.

 Of course if the netloc is too long only because of the password, this
 causes a valid URL to be not accepted.

 The test for length is a requirement for the hostname, so it should test
 .hostname instead of .netloc

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32298>
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/053.15734da874c41e31bcbf407e6dbaceab%40djangoproject.com.

Reply via email to