diff options
Diffstat (limited to 'django/http/request.py')
-rw-r--r-- | django/http/request.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/django/http/request.py b/django/http/request.py index 5a14c2a41a..2538e0a012 100644 --- a/django/http/request.py +++ b/django/http/request.py @@ -567,8 +567,4 @@ def validate_host(host, allowed_hosts): Return ``True`` for a valid host, ``False`` otherwise. """ - for pattern in allowed_hosts: - if pattern == '*' or is_same_domain(host, pattern): - return True - - return False + return any(pattern == '*' or is_same_domain(host, pattern) for pattern in allowed_hosts) |