raintank / raintank-probe

27 stars 12 forks source link

allow overriding host header for http/https checks #39

Closed woodsaj closed 7 years ago

woodsaj commented 7 years ago

If a user sets a "host" header in the check "headers" configuration it is not currently honored.

As documented in https://golang.org/pkg/net/http/#Request, to override the host you need to set request.Host

DanCech commented 7 years ago

so something like this should do the needful, I think:

        if dummyRequest.Host != "" {
            request.Host = dummyRequest.Host
        }
woodsaj commented 7 years ago

yep, exactly that.

DanCech commented 7 years ago

ok, I'll throw that in the downloadLimit branch

woodsaj commented 7 years ago

fixed in https://github.com/raintank/raintank-probe/commit/a2f6ae8aa6cdf798e87899e20654aba81f695b8c