Remove trailing dots from both host and pattern while checking ALLOWED_HOSTS.