mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
fix gosec G307
This commit is contained in:
parent
dfb9bd10f6
commit
ff8bf16171
@ -149,7 +149,9 @@ func (ns *NotificationServerBundle) Send(message string) error {
|
||||
}
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode > 299 {
|
||||
defer resp.Body.Close()
|
||||
defer func() {
|
||||
_ = resp.Body.Close()
|
||||
}()
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
return fmt.Errorf("%d@%s %s", resp.StatusCode, resp.Status, string(body))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user