Francis Lavoie
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
9 additions and
9 deletions
-
caddytest/integration/caddyfile_adapt/reverse_proxy_health_headers.txt
-
modules/caddyhttp/reverseproxy/caddyfile.go
|
|
@ -7,6 +7,7 @@ reverse_proxy 127.0.0.1:65535 { |
|
|
|
X-Header-Keys VbG4NZwWnipo 335Q9/MhqcNU3s2TO |
|
|
|
X-Empty-Value |
|
|
|
} |
|
|
|
health_uri /health |
|
|
|
} |
|
|
|
---------- |
|
|
|
{ |
|
|
@ -38,7 +39,8 @@ reverse_proxy 127.0.0.1:65535 { |
|
|
|
"VbG4NZwWnipo", |
|
|
|
"335Q9/MhqcNU3s2TO" |
|
|
|
] |
|
|
|
} |
|
|
|
}, |
|
|
|
"uri": "/health" |
|
|
|
} |
|
|
|
}, |
|
|
|
"upstreams": [ |
|
|
|
|
|
@ -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) |
|
|
|