An alternative solution would be to provide an URIValidator which allows
more schemes than what we currently have in URLValidator. However, since
sth. like ssh://example.com is not only a valid URI but also a valid URL
[2] it doesn't seem to make sense to differentiate URI and URL.
Related to that, #15229 already added support for ftp(s)
[1] https://en.wikipedia.org/wiki/URI_scheme#Official_IANA-
registered_schemes
[2] https://tools.ietf.org/html/rfc3986
--
Ticket URL: <https://code.djangoproject.com/ticket/21242>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
So https://github.com/django/django/pull/1717 addresses at least the ssh
example, but I'd rather want to generalize URLValidator further.
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:1>
* needs_better_patch: 0 => 1
* component: Uncategorized => Core (Other)
* version: 1.5 => master
* has_patch: 0 => 1
* type: Uncategorized => New feature
* stage: Unreviewed => Accepted
Comment:
Yes, this might be interesting, but only if we generalize accepted
schemes. We should probably add a new `scheme` init parameter allowing to
specify a scheme list (defaulting to ['http', 'https', 'ftp', 'ftps']),
and then check for valid schemes in `__call__`.
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:2>
* owner: nobody => saschpe
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:3>
Comment (by saschpe):
It's now https://github.com/django/django/pull/1759
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:4>
* needs_better_patch: 1 => 0
Comment:
I've provided an alternative patch, based on Sascha's patch:
https://github.com/django/django/pull/2099
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:6>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"6d66ba59488bbd0d4f0c2f32b2921f1512301143"]:
{{{
#!CommitTicketReference repository=""
revision="6d66ba59488bbd0d4f0c2f32b2921f1512301143"
Fixed #21242 -- Allowed more IANA schemes in URLValidator
Thanks Sascha Peilicke for the report and initial patch, and
Tim Graham for the review.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/21242#comment:7>