1
0
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:
Claude Paroz
2013-10-24 19:34:40 +02:00
parent 08c9ab5a0f
commit c052699be3
3 changed files with 14 additions and 6 deletions

View File

@@ -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 = (