@marcel91200 / caddy Mirror · read-only / commits / bd374ca9
Fork 0

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

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 17:15 UTC

caddyhttp: Lowercase comparison when matching with escape sequence

Matthew Holt committed Feb 9, 2026 at 09:43 UTC bd374ca9d72e296c9361aee76924b6540f22f0c0
2 files changed +7 -2
modules/caddyhttp/matchers.go
+2 -2
@@ -632,8 +632,8 @@ func (MatchPath) matchPatternWithEscapeSequence(escapedPath, matchPath string) b
632 // we can now treat rawpath globs (%*) as regular globs (*)
633 matchPath = strings.ReplaceAll(matchPath, "%*", "*")
634
635 - // ignore error here because we can't handle it anyway=
636 - matches, _ := path.Match(matchPath, sb.String())
635 + // ignore error here because we can't handle it anyway
636 + matches, _ := path.Match(matchPath, strings.ToLower(sb.String()))
637 return matches
638 }
639
modules/caddyhttp/matchers_test.go
+5
@@ -412,6 +412,11 @@ func TestPathMatcher(t *testing.T) {
412 input: "/foo%2fbar/baz",
413 expect: true,
414 },
415 + {
416 + match: MatchPath{"/admin%2fpanel"},
417 + input: "/ADMIN%2fpanel",
418 + expect: true,
419 + },
420 } {
421 err := tc.match.Provision(caddy.Context{})
422 if err == nil && tc.provisionErr {