diff --git a/prober/http.go b/prober/http.go index d79e8e1c..e23e23ff 100644 --- a/prober/http.go +++ b/prober/http.go @@ -392,7 +392,6 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr httpConfig.Method = "GET" } - origHost := targetURL.Host if ip != nil { // Replace the host field in the URL with the IP we resolved. if targetPort == "" { @@ -430,7 +429,7 @@ func ProbeHTTP(ctx context.Context, target string, module config.Module, registr level.Error(logger).Log("msg", "Error creating request", "err", err) return } - request.Host = origHost + request.Host = targetHost request = request.WithContext(ctx) for key, value := range httpConfig.Headers {