Opened 3 years ago
Last modified 3 years ago
#33456 closed Cleanup/optimization
Make underscore in hostname error more explicit — at Initial Version
Reported by: | kimsia | Owned by: | |
---|---|---|---|
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
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."