mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #20338 -- Stripped ending dot during host validation
Thanks manfre for the report and Timo Graham for the review.
This commit is contained in:
@@ -520,6 +520,8 @@ def validate_host(host, allowed_hosts):
|
||||
Return ``True`` for a valid host, ``False`` otherwise.
|
||||
|
||||
"""
|
||||
host = host[:-1] if host.endswith('.') else host
|
||||
|
||||
for pattern in allowed_hosts:
|
||||
pattern = pattern.lower()
|
||||
match = (
|
||||
|
||||
Reference in New Issue
Block a user