reverseproxy: Fix incorrect health_headers Caddyfile parsing (#4485)

Fixes #4481
This commit is contained in:
Francis Lavoie
2021-12-17 10:53:11 -05:00
committed by GitHub
parent 180ae0cc48
commit 5333c3528b
2 changed files with 9 additions and 9 deletions
+6 -8
View File
@@ -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)