#32930: URLValidator should accept urls with port number < 10
------------------------------+--------------------------------------
     Reporter:  Wu Haotian    |                    Owner:  Wu Haotian
         Type:  Bug           |                   Status:  assigned
    Component:  Core (Other)  |                  Version:  3.2
     Severity:  Normal        |               Resolution:
     Keywords:  URLValidator  |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------

Comment (by Florian Apolloner):

 Replying to [comment:2 Nick Pope]:
 > Or we can be a little more strict as the port should only be a 16-bit
 unsigned integer (0-65535) and use the following to disallow 65536 and
 higher:
 > {{{
 >
 
(?:[0-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])?
 > }}}

 I would keep the regex simple and perform range validation on it
 afterwards… FWIW I do not think that 0 would be a valid port for a URL

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32930#comment:4>
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/064.f93ace41403a6c708c3b8e6726e60bac%40djangoproject.com.

Reply via email to