#26418: models.URLField does not validate with an rtmp:// url
------------------------------+--------------------
     Reporter:  gitfu         |      Owner:  nobody
         Type:  Bug           |     Status:  new
    Component:  Core (Other)  |    Version:  1.9
     Severity:  Normal        |   Keywords:
 Triage Stage:  Unreviewed    |  Has patch:  0
Easy pickings:  1             |      UI/UX:  0
------------------------------+--------------------
 models.URLField does not validate with an '''rtmp://''' url

 checking the source, it is validated twice

 class URLField(CharField):
  ''   default_validators = [validators.URLValidator()]
     description = _("URL")

 And

     def formfield(self, **kwargs):
         # As with CharField, this will cause URL validation to be
 performed
         # twice.
         defaults = {
             'form_class': forms.URLField,
         }



 in django.core.validators.UrlValidator we find at least one of the
 culprits:

     schemes = ['http', 'https', 'ftp', 'ftps']



 RFC 3986 (I believe retained for RFC7320) defines scheme:

 3.1.  Scheme

    Each URI begins with a scheme name that refers to a specification for
    assigning identifiers within that scheme.  As such, the URI syntax is
    a federated and extensible naming system wherein each scheme's
    specification may further restrict the syntax and semantics of
    identifiers using that scheme.

    Scheme names consist of a sequence of characters beginning with a
    letter and followed by any combination of letters, digits, plus
    ("+"), period ("."), or hyphen ("-").  Although schemes are case-
    insensitive, the canonical form is lowercase and documents that
    specify schemes must do so with lowercase letters.  An implementation
    should accept uppercase letters as equivalent to lowercase in scheme
    names (e.g., allow "HTTP" as well as "http") for the sake of
    robustness but should only produce lowercase scheme names for
    consistency.

       scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

--
Ticket URL: <https://code.djangoproject.com/ticket/26418>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.4dee5ce89757a06be41252fc6a223cfa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to