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:
@ -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)
|
||||
|
Reference in New Issue
Block a user