#25418: URL Validator to check only hostname part without domain nor tld
------------------------------+------------------------------------
     Reporter:  foxmask       |                    Owner:  nobody
         Type:  New feature   |                   Status:  new
    Component:  Core (Other)  |                  Version:  master
     Severity:  Normal        |               Resolution:
     Keywords:                |             Triage Stage:  Accepted
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+------------------------------------

Comment (by jschneier):

 I just ran into this as well. There is also no whitelist of hostnames that
 I can hardcode (so that solution is out). Unfortunately the data is
 entered via a CMS which is using `URLValidator` internally and leaving
 users quite frustrated.

 Is changing `host_re` to

 `host_re = '(' + hostname_re + domain_re + tld_re + '|' + hostname_re +
 '|localhost)'`

 as suggested by the original reporter of this issue out of the question?
 That seems like the simplest way to fix this and will bring Django more
 in-line with the RFC that lays out URLs.

--
Ticket URL: <https://code.djangoproject.com/ticket/25418#comment:6>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.c38e90c6452c1bfd6bca5d8541a27bec%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to