mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 12:08:28 +08:00
caddyhttp: Very minor optimization to path matcher
If * is in the matcher it will always match so we can just put it first.
This commit is contained in:
parent
61c75f74de
commit
20d487be57
|
@ -374,7 +374,11 @@ func (MatchPath) CaddyModule() caddy.ModuleInfo {
|
|||
// Provision lower-cases the paths in m to ensure case-insensitive matching.
|
||||
func (m MatchPath) Provision(_ caddy.Context) error {
|
||||
for i := range m {
|
||||
// TODO: if m[i] == "*", put it first and delete all others (will always match)
|
||||
if m[i] == "*" && i > 0 {
|
||||
// will always match, so just put it first
|
||||
m[0] = m[i]
|
||||
break
|
||||
}
|
||||
m[i] = strings.ToLower(m[i])
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user