mirror of
https://github.com/django/django.git
synced 2025-12-08 02:36:40 +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:
parent
08c9ab5a0f
commit
c052699be3
3 changed files with 14 additions and 6 deletions
|
|
@ -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 = (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue