Fix redundant backslash escape in hostname regex character class

This commit is contained in:
copilot-swe-agent[bot]
2026-07-27 11:41:44 +00:00
committed by GitHub
parent 154988bbeb
commit dc98a355e8
+1 -1
View File
@@ -4094,7 +4094,7 @@ def _validate_safe_name(name: str) -> bool:
# Hostname characters: letters, digits, hyphens only within labels; dots separate labels.
# Each label must start and end with a letter or digit; no consecutive dots.
_HOSTNAME_RE = re.compile(
r'^[a-z0-9]([a-z0-9\-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9\-]*[a-z0-9])?)*$'
r'^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$'
)
# Managed domain keys that produce Caddy virtual-host blocks (excluding sslemail)