mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #31010 -- Allowed subdomains of localhost in the Host header by default when DEBUG=True.
This commit is contained in:
parent
3930ec1bf2
commit
adb9661789
4 changed files with 10 additions and 4 deletions
|
@ -758,7 +758,7 @@ class HostValidationTests(SimpleTestCase):
|
|||
If ALLOWED_HOSTS is empty and DEBUG is True, variants of localhost are
|
||||
allowed.
|
||||
"""
|
||||
valid_hosts = ['localhost', '127.0.0.1', '[::1]']
|
||||
valid_hosts = ['localhost', 'subdomain.localhost', '127.0.0.1', '[::1]']
|
||||
for host in valid_hosts:
|
||||
request = HttpRequest()
|
||||
request.META = {'HTTP_HOST': host}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue