mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-28 04:41:41 +00:00
Enhance just one wildcard matching for host patterns
This commit is contained in:
parent
39c9a85f80
commit
5c09fa9dc9
1 changed files with 5 additions and 1 deletions
|
|
@ -342,7 +342,11 @@ outer:
|
|||
}
|
||||
|
||||
host = repl.ReplaceAll(host, "")
|
||||
if strings.Contains(host, "*") {
|
||||
|
||||
// a single * always match
|
||||
if host == "*" {
|
||||
return true, nil
|
||||
} else if strings.Contains(host, "*") {
|
||||
patternParts := strings.Split(host, ".")
|
||||
incomingParts := strings.Split(reqHost, ".")
|
||||
if len(patternParts) != len(incomingParts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue