diff --git a/evibes/middleware.py b/evibes/middleware.py index f80b8a0d..73b974dd 100644 --- a/evibes/middleware.py +++ b/evibes/middleware.py @@ -69,7 +69,20 @@ class BlockInvalidHostMiddleware: self.get_response = get_response def __call__(self, request): - allowed_hosts = getenv("ALLOWED_HOSTS").split(" ") + allowed_hosts = ["app:8000", + "worker:8000", + "beat:8000", + "localhost:8000", + "api.localhost:8000", + "b2b.localhost:8000", + "127.0.0.1:8000", + "api.127.0.0.1:8000", + "b2b.127.0.0.1:8000"] + + if DEBUG: + allowed_hosts += ["*"] + else: + allowed_hosts += getenv("ALLOWED_HOSTS").split(" ") if not hasattr(request, "META"): return BadRequest("Invalid Request") if DEBUG: