mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-30 22:34:15 -05:00
reverseproxy: Fix incorrect health_headers
Caddyfile parsing (#4485)
Fixes #4481
This commit is contained in:
parent
180ae0cc48
commit
5333c3528b
2 changed files with 9 additions and 9 deletions
|
@ -7,6 +7,7 @@ reverse_proxy 127.0.0.1:65535 {
|
||||||
X-Header-Keys VbG4NZwWnipo 335Q9/MhqcNU3s2TO
|
X-Header-Keys VbG4NZwWnipo 335Q9/MhqcNU3s2TO
|
||||||
X-Empty-Value
|
X-Empty-Value
|
||||||
}
|
}
|
||||||
|
health_uri /health
|
||||||
}
|
}
|
||||||
----------
|
----------
|
||||||
{
|
{
|
||||||
|
@ -38,7 +39,8 @@ reverse_proxy 127.0.0.1:65535 {
|
||||||
"VbG4NZwWnipo",
|
"VbG4NZwWnipo",
|
||||||
"335Q9/MhqcNU3s2TO"
|
"335Q9/MhqcNU3s2TO"
|
||||||
]
|
]
|
||||||
}
|
},
|
||||||
|
"uri": "/health"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"upstreams": [
|
"upstreams": [
|
||||||
|
|
|
@ -361,15 +361,13 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
|
|
||||||
case "health_headers":
|
case "health_headers":
|
||||||
healthHeaders := make(http.Header)
|
healthHeaders := make(http.Header)
|
||||||
for d.Next() {
|
for nesting := d.Nesting(); d.NextBlock(nesting); {
|
||||||
for d.NextBlock(0) {
|
key := d.Val()
|
||||||
key := d.Val()
|
values := d.RemainingArgs()
|
||||||
values := d.RemainingArgs()
|
if len(values) == 0 {
|
||||||
if len(values) == 0 {
|
values = append(values, "")
|
||||||
values = append(values, "")
|
|
||||||
}
|
|
||||||
healthHeaders[key] = values
|
|
||||||
}
|
}
|
||||||
|
healthHeaders[key] = values
|
||||||
}
|
}
|
||||||
if h.HealthChecks == nil {
|
if h.HealthChecks == nil {
|
||||||
h.HealthChecks = new(HealthChecks)
|
h.HealthChecks = new(HealthChecks)
|
||||||
|
|
Loading…
Reference in a new issue