Skip to content

Commit a108119

Browse files
mholtmanizada
andauthored
Merge commit from fork
Necessary as otherwise the early-bail in `until = strings.IndexByte(remaining, nextCh) ... if until == -1` can cause a case-insensitive mismatch Co-authored-by: Asim Viladi Oglu Manizada <manizada@users.noreply.github.com>
1 parent eec32a0 commit a108119

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

modules/caddyhttp/matchers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ func (m MatchPath) MatchWithError(r *http.Request) (bool, error) {
538538
}
539539

540540
func (MatchPath) matchPatternWithEscapeSequence(escapedPath, matchPath string) bool {
541+
escapedPath = strings.ToLower(escapedPath)
541542
// We would just compare the pattern against r.URL.Path,
542543
// but the pattern contains %, indicating that we should
543544
// compare at least some part of the path in raw/escaped

modules/caddyhttp/matchers_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,11 @@ func TestPathMatcher(t *testing.T) {
417417
input: "/ADMIN%2fpanel",
418418
expect: true,
419419
},
420+
{
421+
match: MatchPath{"/admin%2fpa*el"},
422+
input: "/ADMIN%2fPaAzZLm123NEL",
423+
expect: true,
424+
},
420425
} {
421426
err := tc.match.Provision(caddy.Context{})
422427
if err == nil && tc.provisionErr {

0 commit comments

Comments
 (0)