mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #31010 -- Allowed subdomains of localhost in the Host header by default when DEBUG=True.
This commit is contained in:
committed by
Mariusz Felisiak
parent
3930ec1bf2
commit
adb9661789
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user