SIGN IN SIGN UP
caddyserver / caddy UNCLAIMED

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

0 0 75 Go

httpcaddyfile: fix incorrect error message on duplicate matchers (#7780)

Parse each matcher segment individually using NewDispenser(segment) instead
of DispenseDirective(dir), which coalesced all same-name segments into one
token stream. This caused the second definition name to be misinterpreted
as a matcher module name, producing 'module not registered: http.matchers.@name'
instead of the correct 'matcher is defined more than once' error.

By parsing segments individually, the existing duplicate check in
parseMatcherDefinitions naturally catches the duplicate on the second pass.

Signed-off-by: Brunotlps <brunoteixlps@gmail.com>
B
Bruno Teixeira Lopes committed
0e8eb41b87ab60803d48cb2a183face3f4e4248e
Parent: 3eb8e48
Committed by GitHub <noreply@github.com> on 5/29/2026, 9:05:41 PM