Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#33456 closed Cleanup/optimization (wontfix)

Make underscore in hostname error more explicit — at Version 2

Reported by: kimsia Owned by: nobody
Component: HTTP handling Version: 3.2
Severity: Normal Keywords:
Cc: Florian Apolloner Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by kimsia)

Currently, the error message is simply

"The domain name provided is not valid according to RFC 1034/1035."

Most tickets filed against this topic is about how underscores should be allowed. I agreed with Django's choice to invalidate underscores.

https://github.com/django/django/pull/594 explains this clearly.

However, the error message can be clearer.

I recommend when underscore is detected, simply make it more explicit

" %r contains _ and that is not valid according to RFC 1034/1035." % domain

Otherwise, "The domain name provided is not valid according to RFC 1034/1035."

Patch: https://github.com/django/django/pull/15343

Change History (2)

comment:1 by Mariusz Felisiak, 3 years ago

Cc: Florian Apolloner added
Component: Error reportingHTTP handling
Owner: set to nobody
Resolution: wontfix
Status: newclosed

Thanks for this ticket, however I see no reason to treat the underscore differently from the other forbidden chars.

I agreed with Django's choice to invalidate underscores.

Is this really Django's choice? 🤔 As far as I'm aware they are forbidden in RFC 1035 and we're not doing anything unusual here.

Last edited 3 years ago by Mariusz Felisiak (previous) (diff)

comment:2 by kimsia, 3 years ago

Description: modified (diff)
Has patch: set
Note: See TracTickets for help on using tickets.
Back to Top