Skip to content

Commit d276abe

Browse files
committed
Allow overriding Host configuration in HTTP checks
1 parent 72c0297 commit d276abe

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.20-1-buster as build-env
1+
FROM golang:1.20.5-bullseye as build-env
22

33
ADD . /app
44
WORKDIR /app

docker.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
version=$1
44

5-
docker build -t mcorbin/cabourotte:${version} .
6-
docker push mcorbin/cabourotte:${version}
5+
docker build -t appclacks/cabourotte:${version} .
6+
docker push appclacks/cabourotte:${version}

healthcheck/http.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ type HTTPHealthcheckConfiguration struct {
2727
ValidStatus []uint `json:"valid-status" yaml:"valid-status"`
2828
// can be an IP or a domain
2929
Target string `json:"target"`
30+
Host string `json:"host,omitempty"`
3031
Method string `json:"method"`
3132
Port uint `json:"port"`
3233
Redirect bool `json:"redirect"`
@@ -233,6 +234,9 @@ func (h *HTTPHealthcheck) Execute() error {
233234
if h.Config.Redirect {
234235
redirect = nil
235236
}
237+
if h.Config.Host != "" {
238+
req.Host = h.Config.Host
239+
}
236240
client := &http.Client{
237241
Transport: h.transport,
238242
CheckRedirect: func(req *http.Request, via []*http.Request) error {

0 commit comments

Comments
 (0)