Merge pull request #943 from L3o-pold/hotfix/fix-alerting-http-proxy

Fix for the http client proxy overriding the default client
This commit is contained in:
Stefan Prodan
2021-06-24 17:14:52 +03:00
committed by GitHub
2 changed files with 2 additions and 5 deletions
+1 -4
View File
@@ -61,10 +61,7 @@ func callWebhook(webhook string, payload interface{}, timeout string) error {
ctx, cancel := context.WithTimeout(req.Context(), t)
defer cancel()
httpClient := http.DefaultClient
httpClient.Transport = http.DefaultTransport
r, err := httpClient.Do(req.WithContext(ctx))
r, err := http.DefaultClient.Do(req.WithContext(ctx))
if err != nil {
return err
}
+1 -1
View File
@@ -30,7 +30,7 @@ import (
)
func postMessage(address string, proxy string, payload interface{}) error {
httpClient := http.DefaultClient
var httpClient = &http.Client{}
if proxy != "" {
proxyURL, err := url.Parse(proxy)