mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-04 06:53:36 +00:00
caddyhttp: Lowercase comparison when matching with escape sequence
This commit is contained in:
parent
2ae0f7af69
commit
bd374ca9d7
2 changed files with 7 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue