mirror of
https://github.com/caddyserver/caddy.git
synced 2026-02-15 07:52:08 -05:00
caddyhttp: Lowercase comparison when matching with escape sequence
This commit is contained in:
parent
2ae0f7af69
commit
bd374ca9d7
@ -632,8 +632,8 @@ func (MatchPath) matchPatternWithEscapeSequence(escapedPath, matchPath string) b
|
||||
// we can now treat rawpath globs (%*) as regular globs (*)
|
||||
matchPath = strings.ReplaceAll(matchPath, "%*", "*")
|
||||
|
||||
// ignore error here because we can't handle it anyway=
|
||||
matches, _ := path.Match(matchPath, sb.String())
|
||||
// ignore error here because we can't handle it anyway
|
||||
matches, _ := path.Match(matchPath, strings.ToLower(sb.String()))
|
||||
return matches
|
||||
}
|
||||
|
||||
|
||||
@ -412,6 +412,11 @@ func TestPathMatcher(t *testing.T) {
|
||||
input: "/foo%2fbar/baz",
|
||||
expect: true,
|
||||
},
|
||||
{
|
||||
match: MatchPath{"/admin%2fpanel"},
|
||||
input: "/ADMIN%2fpanel",
|
||||
expect: true,
|
||||
},
|
||||
} {
|
||||
err := tc.match.Provision(caddy.Context{})
|
||||
if err == nil && tc.provisionErr {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user