ntfy-alertmanager/http.go

15 lines
333 B
Go
Raw Normal View History

2023-02-20 13:27:41 +01:00
package main
import "net/http"
// httpClient is a wrapper around the default http.Client
// It is used to add default headers to the requests.
type httpClient struct {
*http.Client
}
func (c *httpClient) Do(req *http.Request) (*http.Response, error) {
req.Header.Set("User-Agent", "ntfy-alertmanger")
return c.Client.Do(req)
}