projects
/
blackbox_exporter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
102e998
)
http: abort probing when request could not be created
author
Michael Stapelberg
<stapelberg@google.com>
Tue, 24 Nov 2015 17:10:48 +0000
(18:10 +0100)
committer
Michael Stapelberg
<stapelberg@google.com>
Tue, 24 Nov 2015 17:14:28 +0000
(18:14 +0100)
As per https://play.golang.org/p/4keb0zznDB, passing a nil http.Request
to Client.Do() results in a runtime error.
http.go
patch
|
blob
|
blame
|
history
diff --git
a/http.go
b/http.go
index 0d1c279aa89322fd99c1b4aab5db0c3b806ee6c0..52ccfd4ef07dffbb0a27d59687989e8f3d1f9e7e 100644
(file)
--- 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)