mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-30 10:35:18 -04:00
reverseproxy: Fix incorrect health_headers Caddyfile parsing (#4485)
Fixes #4481
This commit is contained in:
@@ -361,15 +361,13 @@ func (h *Handler) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||
|
||||
case "health_headers":
|
||||
healthHeaders := make(http.Header)
|
||||
for d.Next() {
|
||||
for d.NextBlock(0) {
|
||||
key := d.Val()
|
||||
values := d.RemainingArgs()
|
||||
if len(values) == 0 {
|
||||
values = append(values, "")
|
||||
}
|
||||
healthHeaders[key] = values
|
||||
for nesting := d.Nesting(); d.NextBlock(nesting); {
|
||||
key := d.Val()
|
||||
values := d.RemainingArgs()
|
||||
if len(values) == 0 {
|
||||
values = append(values, "")
|
||||
}
|
||||
healthHeaders[key] = values
|
||||
}
|
||||
if h.HealthChecks == nil {
|
||||
h.HealthChecks = new(HealthChecks)
|
||||
|
||||
Reference in New Issue
Block a user