Skip to content

Commit

Permalink
Ignore defer close gosec warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanoogian committed Apr 25, 2023
1 parent ffde32a commit 637e29b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func performRequest(req *http.Request, verifyTLS bool) (int, http.Header, []byte
resp, err := client.Do(req) // nosemgrep: trailofbits.go.invalid-usage-of-modified-variable.invalid-usage-of-modified-variable
if err != nil {
if resp != nil {
defer resp.Body.Close()
defer resp.Body.Close() // #nosec: G307
}

utils.LogDebug(err.Error())
Expand Down Expand Up @@ -264,7 +264,7 @@ func performRequest(req *http.Request, verifyTLS bool) (int, http.Header, []byte
})

if response != nil {
defer response.Body.Close()
defer response.Body.Close() // #nosec: G307
}

if requestErr != nil && response == nil {
Expand Down

0 comments on commit 637e29b

Please sign in to comment.