Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#31768 closed Cleanup/optimization (invalid)

`django.http.request` `validate_domains` - should be optional "Invalid HTTP_HOST header"

Reported by: Mateusz Kurowski Owned by: nobody
Component: HTTP handling Version: 3.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

https://github.com/django/django/blob/master/django/http/request.py#L129

Working with this, i cannot simply use docker host resolution because my host is invalid:

Invalid HTTP_HOST header: 'my_service:8000'. The domain name provided is not valid according to RFC 1034/1035.

This is really annoying as Django and any other project should !!never ever!! force us to check thing that may be irrevelant for the user! Doing this is the first cause of wasting time and workarounds for simple problems - !! assuming that code knows better what the human needs is wrong !!.
Just saying loudly what i think, no offense.

Can we work on this problem?

Change History (1)

comment:1 by Carlton Gibson, 4 years ago

Resolution: invalid
Status: newclosed

Underscores are not permitted in hostnames. If you try to use them, you'll have problems with more than just Django.

Remove the _:

>>> from django.http.request import split_domain_port
>>> split_domain_port('my_service:8000')
('', '')
>>> split_domain_port('myservice.com:8000')
('myservice.com', '8000')
>>> split_domain_port('my-service.com:8000')
('my-service.com', '8000')

Please see TicketClosingReasons/UseSupportChannels.

Last edited 4 years ago by Carlton Gibson (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top