1
0
mirror of https://github.com/bgp/stayrtr.git synced 2024-05-06 15:54:54 +00:00

check for err

This commit is contained in:
Ties de Kock
2021-10-25 20:19:28 +02:00
parent 0a9217aaad
commit e5c5a99a0c

View File

@ -72,6 +72,10 @@ func (c *FetchConfig) FetchFile(file string) ([]byte, int, bool, error) {
client := &http.Client{Transport: tr}
req, err := http.NewRequest("GET", file, nil)
if err != nil {
return nil, -1, false, err
}
req.Header.Set("User-Agent", c.UserAgent)
if c.Mime != "" {
req.Header.Set("Accept", c.Mime)