diff --git a/.gitignore b/.gitignore index 48ce1e98..93451de8 100644 --- a/.gitignore +++ b/.gitignore @@ -79,11 +79,11 @@ db_backups services_data services_data/postgres/* services_data/redis/* -./static -!core/static/* -!geo/static/* -!payments/static/* -!vibes_auth/static/* +static +!core/static +!geo/static +!payments/static +!vibes_auth/static media debug.log errors.log diff --git a/evibes/middleware.py b/evibes/middleware.py index 1ed9e89f..0893cb7d 100644 --- a/evibes/middleware.py +++ b/evibes/middleware.py @@ -73,7 +73,8 @@ class BlockInvalidHostMiddleware: self.get_response = get_response def __call__(self, request): - if request.META.get("HTTP_HOST") not in getenv("ALLOWED_HOSTS").split(" "): + allowed_hosts = getenv("ALLOWED_HOSTS").split(" ") + if request.META.get("HTTP_HOST") not in allowed_hosts and "*" not in allowed_hosts: return HttpResponseForbidden("Invalid Host Header") return self.get_response(request)