From d6f2a05f8d5e700f33341d4d7fb45d597c5d9232 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 18 Feb 2026 09:03:49 -0700 Subject: [PATCH] caddyhttp: Normalize hosts in provision --- modules/caddyhttp/matchers.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go index afba1b36f..54bb5f72f 100644 --- a/modules/caddyhttp/matchers.go +++ b/modules/caddyhttp/matchers.go @@ -262,13 +262,11 @@ func (m MatchHost) Provision(_ caddy.Context) error { if err != nil { return fmt.Errorf("converting hostname '%s' to ASCII: %v", host, err) } - if asciiHost != host { - m[i] = asciiHost - } normalizedHost := strings.ToLower(asciiHost) if firstI, ok := seen[normalizedHost]; ok { return fmt.Errorf("host at index %d is repeated at index %d: %s", firstI, i, host) } + m[i] = normalizedHost // normalize for all comparisons while matching seen[normalizedHost] = i }