Chrome resolves *.localhost to localhost without modifying any host files
or DNS
Referencing the project this way makes it easy to test subdomains ->
static.localhost, uploads.localhost, www.localhost, etc
--
Ticket URL: <https://code.djangoproject.com/ticket/31010>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => needsinfo
Comment:
Interesting. Currently we have, in HttpRequest.get_host():
{{{
# Allow variants of localhost if ALLOWED_HOSTS is empty and
DEBUG=True.
allowed_hosts = settings.ALLOWED_HOSTS
if settings.DEBUG and not allowed_hosts:
allowed_hosts = ['localhost', '127.0.0.1', '[::1]']
}}}
Can I ask you to post to the DevelopersMailingList to canvas opinion?
Assuming no blockers are raised it seems reasonable enough... (Reopen if
accepted there.)
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:1>
Comment (by thenewguy):
For reference, the conversation chain has been started:
https://groups.google.com/forum/#!topic/django-developers/xcoAF9Gm_dI
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:2>
* status: closed => new
* resolution: needsinfo =>
* easy: 0 => 1
* stage: Unreviewed => Accepted
Old description:
> It would minimize configuration for new projects if ALLOWED_HOSTS +=
> ['.localhost'] when DEBUG=True
>
> Chrome resolves *.localhost to localhost without modifying any host files
> or DNS
>
> Referencing the project this way makes it easy to test subdomains ->
> static.localhost, uploads.localhost, www.localhost, etc
New description:
It would minimize configuration for new projects if ALLOWED_HOSTS +=
['.localhost'] when DEBUG=True
Chrome resolves *.localhost to localhost without modifying any host files
or DNS
Referencing the project this way makes it easy to test subdomains ->
static.localhost, uploads.localhost, www.localhost, etc
---
Updated
---
Conversation on developer mailing list resulted in decision to reopen and
accept ticket. The conversation turned up that this behavior is spec
compliant per https://tools.ietf.org/html/rfc6761#section-6.3
--
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:3>
* owner: nobody => thenewguy
* status: new => assigned
* has_patch: 0 => 1
Comment:
PR submitted https://github.com/django/django/pull/12132
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:4>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:5>
* needs_better_patch: 0 => 1
* needs_tests: 0 => 1
* stage: Ready for checkin => Accepted
Comment:
Hey there, thanks for your PR! Please don't mark your own patch ''Ready
for Checking'', someone else has to review it and mark it accordingly. I
left come comments for improvements on the PR.
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:6>
* type: Uncategorized => New feature
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:7>
* needs_better_patch: 1 => 0
* version: 2.2 => master
* component: Uncategorized => HTTP handling
* needs_tests: 1 => 0
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:8>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"adb96617897690b3a01e39e8297ae7d67825d2bc" adb9661]:
{{{
#!CommitTicketReference repository=""
revision="adb96617897690b3a01e39e8297ae7d67825d2bc"
Fixed #31010 -- Allowed subdomains of localhost in the Host header by
default when DEBUG=True.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/31010#comment:9>