Skip to content

Commit

Permalink
fix key error
Browse files Browse the repository at this point in the history
  • Loading branch information
ludvigalden committed Mar 9, 2024
1 parent 74b87e0 commit 1025a31
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/admin/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class TrustedHostMiddleware(MiddlewareMixin):
"""

def __call__(self, request):
if (request.META['HTTP_HOST'] and
self.is_allowed_host(request.META['HTTP_HOST'])):
current_host = request.META.get('HTTP_HOST', '')
if (current_host and self.is_allowed_host(current_host)):
return self.get_response(request)

headers_to_check = [
Expand Down

0 comments on commit 1025a31

Please sign in to comment.