diff --git a/metecho/routing.py b/metecho/routing.py index 4402c30f9..e06b16fb2 100644 --- a/metecho/routing.py +++ b/metecho/routing.py @@ -1,5 +1,6 @@ from channels.auth import AuthMiddlewareStack from channels.routing import ProtocolTypeRouter, URLRouter +from channels.security.websocket import AllowedHostsOriginValidator from django.core.asgi import get_asgi_application from django.urls import path @@ -17,5 +18,8 @@ application = ProtocolTypeRouter( - {"http": get_asgi_application(), "websocket": AuthMiddlewareStack(websockets)} + { + "http": get_asgi_application(), + "websocket": AllowedHostsOriginValidator(AuthMiddlewareStack(websockets)), + } )