Correct 2nd Iter: Hostnames to lowercase.

As mentioned by @StevenBlack in #2400, hostnames should be
converted to lowercase.
This commit is contained in:
funilrys
2023-09-07 18:46:54 +02:00
parent 422d6a5d98
commit 3b4709f25f
2 changed files with 23 additions and 0 deletions

View File

@@ -1123,6 +1123,8 @@ def normalize_rule(rule, target_ip, keep_domain_comments):
# Example: 0.0.0.0 example.org
hostname, suffix = split_rule[-1], None
hostname = hostname.lower()
if (
is_ip(hostname)
or re.search(static_ip_regex, hostname)
@@ -1154,6 +1156,8 @@ def normalize_rule(rule, target_ip, keep_domain_comments):
except ValueError:
hostname, suffix = split_rule[0], None
hostname = hostname.lower()
return normalize_response(hostname, suffix)
return belch_unwanted(rule)