mirror of
https://github.com/caddyserver/caddy.git
synced 2026-02-23 19:50:00 -05:00
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>
This commit is contained in:
parent
eec32a0bb5
commit
a1081194bf
@ -538,6 +538,7 @@ func (m MatchPath) MatchWithError(r *http.Request) (bool, error) {
|
||||
}
|
||||
|
||||
func (MatchPath) matchPatternWithEscapeSequence(escapedPath, matchPath string) bool {
|
||||
escapedPath = strings.ToLower(escapedPath)
|
||||
// We would just compare the pattern against r.URL.Path,
|
||||
// but the pattern contains %, indicating that we should
|
||||
// compare at least some part of the path in raw/escaped
|
||||
|
||||
@ -417,6 +417,11 @@ func TestPathMatcher(t *testing.T) {
|
||||
input: "/ADMIN%2fpanel",
|
||||
expect: true,
|
||||
},
|
||||
{
|
||||
match: MatchPath{"/admin%2fpa*el"},
|
||||
input: "/ADMIN%2fPaAzZLm123NEL",
|
||||
expect: true,
|
||||
},
|
||||
} {
|
||||
err := tc.match.Provision(caddy.Context{})
|
||||
if err == nil && tc.provisionErr {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user