~
https://github.com/django/django/blob/master/django/core/validators.py#L99
~ https://github.com/django/django/blob/master/django/http/request.py#L25
--
Ticket URL: <https://code.djangoproject.com/ticket/26244>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* component: Uncategorized => HTTP handling
* needs_better_patch: => 0
* type: Uncategorized => Cleanup/optimization
* needs_tests: => 0
* needs_docs: => 0
Comment:
Unless there is some problem that fixing this will solve, I vote not to
try to combine the two. `URLValidator` changes too often. If we cause some
regression there, at least it's some limited compared to if we also break
`django.http.request`.
--
Ticket URL: <https://code.djangoproject.com/ticket/26244#comment:1>
Comment (by zachborboa):
`host_validation_re` could be changed from
{{{#!python
host_validation_re =
re.compile(r"^([a-z0-9.-]+|\[[a-f0-9]*:[a-f0-9:]+\])(:\d+)?$")
}}}
to something like
{{{#!python
host_validation_re = re.compile(
r'(?:' + ipv4_re + '|' + ipv6_re + '|' + host_re + ')'
r'(?::\d{2,5})?' # port
)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/26244#comment:2>
* cc: apollo13 (added)
Comment:
Florian, what do you think? The regular expression in `request.py` is a
security fix from 27560924ec1e567be4727ef8d7dfc4d3879c048c.
--
Ticket URL: <https://code.djangoproject.com/ticket/26244#comment:3>
Comment (by apollo13):
I do not see big wins in changing it and am worried that it becomes a
nightmare like we have with host_re. Simple & easy is preferable in those
code paths imo.
--
Ticket URL: <https://code.djangoproject.com/ticket/26244#comment:4>
* status: new => closed
* resolution: => wontfix
Comment:
Thanks, sounds like we're in agreement then.
--
Ticket URL: <https://code.djangoproject.com/ticket/26244#comment:5>