Opened 13 years ago
Closed 12 years ago
#18178 closed Bug (wontfix)
URLField -- TLD part can not start/end with hyphen
Reported by: | Miloslav Pojman | Owned by: | nobody |
---|---|---|---|
Component: | Forms | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
URLField accepts URLs where a TLD part of the domain name starts or ends with a hyphen.
>>> URLField().clean("example.-com") u'http://example.-com/' >>> URLField().clean("example.com-") u'http://example.com-/'
Change History (3)
comment:1 by , 13 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 12 years ago
Our implementation uses Python's urlparse.urlsplit()
, which allows that. Not sure whether that should be considered a bug in the Python standard library.
comment:3 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I think the current validation is already doing a good job. Reopen if a you can provide a patch which doesn't complicate things too much.
Note:
See TracTickets
for help on using tickets.
The concept of what is and what isn't an URL isn't very well defined. The regexp given by the RFC matches absolutely anything (see https://code.djangoproject.com/ticket/9202#comment:4).
I'm not excited by the idea of tweaking the current validation...