From cc3c62d97aeca0e4019a1a354c6101db1772800e Mon Sep 17 00:00:00 2001 From: Adam Taylor Date: Fri, 3 Jun 2022 16:48:39 -0600 Subject: [PATCH] Add subdomains of localhost to the default DEBUG mode allowed_hosts --- channels/security/websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channels/security/websocket.py b/channels/security/websocket.py index eff745e8..512774c5 100644 --- a/channels/security/websocket.py +++ b/channels/security/websocket.py @@ -140,7 +140,7 @@ def AllowedHostsOriginValidator(application): """ allowed_hosts = settings.ALLOWED_HOSTS if settings.DEBUG and not allowed_hosts: - allowed_hosts = ["localhost", "127.0.0.1", "[::1]"] + allowed_hosts = [".localhost", "127.0.0.1", "[::1]"] return OriginValidator(application, allowed_hosts)