#20038: Misleading port number in  'Invalid HTTP_HOST header' error message
-------------------------------+--------------------
     Reporter:  wrr@…          |      Owner:  nobody
         Type:  Uncategorized  |     Status:  new
    Component:  Uncategorized  |    Version:  1.5
     Severity:  Normal         |   Keywords:
 Triage Stage:  Unreviewed     |  Has patch:  0
Easy pickings:  0              |      UI/UX:  0
-------------------------------+--------------------
 If port number is incorrectly included in the ALLOWED_HOSTS setting:


 {{{
 ALLOWED_HOSTS = ['foo.example.org:8080']
 }}}


 The raised exception suggests to set ALLOWED_HOSTS to the same incorrect
 value:


 {{{
 SuspiciousOperation: Invalid HTTP_HOST header (you may need to set
 ALLOWED_HOSTS): foo.example.org:8080
 }}}


 It would be better for the exception to be thrown like this:


 {{{
 raise SuspiciousOperation("Invalid HTTP_HOST header (you may need to set
 ALLOWED_HOSTS): %s" % host.rsplit(':', 1)[0])
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20038>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to