From c085629405b05e6f4bfbc385fb3e1831a0f54da9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 24 Nov 2015 18:10:48 +0100 Subject: [PATCH] http: abort probing when request could not be created As per https://play.golang.org/p/4keb0zznDB, passing a nil http.Request to Client.Do() results in a runtime error. --- http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/http.go b/http.go index 0d1c279..52ccfd4 100644 --- a/http.go +++ b/http.go @@ -48,6 +48,7 @@ func probeHTTP(target string, w http.ResponseWriter, module Module) (success boo request, err := http.NewRequest(config.Method, target, nil) if err != nil { log.Errorf("Error creating request for target %s: %s", target, err) + return } resp, err := client.Do(request) -- 2.25.1