Skip to content

Commit

Permalink
Don't ignore error from http.NewRequest (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
flimzy authored Oct 30, 2024
1 parent edcdf0a commit 754cf27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions logziosender.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ func (l *LogzioSender) makeHttpRequest(data bytes.Buffer, attempt int, c bool) i
lost = "0"
}
req, err := http.NewRequest("POST", l.url, &data)
if err != nil {
l.debugLog("sender: Error creating HTTP request for %s %s\n", l.url, err)
return httpError
}
req.Header.Add("Content-Type", "text/plain")
req.Header.Add("logzio-shipper", fmt.Sprintf("logzio-go/v1.0.0/%d/%s", attempt, lost))
if c {
Expand Down

0 comments on commit 754cf27

Please sign in to comment.