mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-23 20:33:48 +08:00
headers: Replaced usage of Url to Path in setup
This commit is contained in:
parent
d9dc9326f2
commit
df6efe5d88
|
@ -29,17 +29,17 @@ func headersParse(c *Controller) ([]headers.Rule, error) {
|
|||
}
|
||||
pattern := c.Val()
|
||||
|
||||
// See if we already have a definition for this URL pattern...
|
||||
// See if we already have a definition for this Path pattern...
|
||||
for _, h := range rules {
|
||||
if h.Url == pattern {
|
||||
if h.Path == pattern {
|
||||
head = h
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// ...otherwise, this is a new pattern
|
||||
if head.Url == "" {
|
||||
head.Url = pattern
|
||||
if head.Path == "" {
|
||||
head.Path = pattern
|
||||
isNewPattern = true
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ func headersParse(c *Controller) ([]headers.Rule, error) {
|
|||
rules = append(rules, head)
|
||||
} else {
|
||||
for i := 0; i < len(rules); i++ {
|
||||
if rules[i].Url == pattern {
|
||||
if rules[i].Path == pattern {
|
||||
rules[i] = head
|
||||
break
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user