mirror of https://github.com/statping/statping
allow user to overwrite user-agent header
parent
f089364884
commit
aeaba54f82
|
@ -177,6 +177,10 @@ func HttpRequest(endpoint, method string, content interface{}, headers []string,
|
|||
req.Header.Set("Content-Type", content.(string))
|
||||
}
|
||||
|
||||
// set default headers so end user can overwrite them if needed
|
||||
req.Header.Set("User-Agent", "Statping")
|
||||
req.Header.Set("Statping-Version", Version)
|
||||
|
||||
verifyHost := req.URL.Hostname()
|
||||
for _, h := range headers {
|
||||
keyVal := strings.SplitN(h, "=", 2)
|
||||
|
@ -192,9 +196,6 @@ func HttpRequest(endpoint, method string, content interface{}, headers []string,
|
|||
}
|
||||
}
|
||||
|
||||
req.Header.Set("User-Agent", "Statping")
|
||||
req.Header.Set("Statping-Version", Version)
|
||||
|
||||
var resp *http.Response
|
||||
|
||||
dialer := &net.Dialer{
|
||||
|
|
Loading…
Reference in New Issue