Skip to content

Commit

Permalink
fix lint bodyclose
Browse files Browse the repository at this point in the history
  • Loading branch information
andersonvcv committed Dec 27, 2024
1 parent 8bf8b0e commit 92e7960
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,12 @@ func (p *OAuthProxy) backendLogout(rw http.ResponseWriter, req *http.Request, si
}

resp, err = PicsSignOutAllSessions(providerData.BackendLogoutAllSessionsURL, session.IntrospectClaims, session.AccessToken)
if err != nil {
logger.Errorf("error while calling backend logout all sessions: %v", err)
return
}

defer resp.Body.Close()
} else {
if providerData.BackendLogoutURL == "" {
return
Expand All @@ -814,14 +820,14 @@ func (p *OAuthProxy) backendLogout(rw http.ResponseWriter, req *http.Request, si
// security exception because URL is dynamic ({id_token} replacement) but
// base is not end-user provided but comes from configuration somewhat secure
resp, err = http.Get(backendLogoutURL) // #nosec G107
}
if err != nil {
logger.Errorf("error while calling backend logout: %v", err)
return
}

if err != nil {
logger.Errorf("error while calling backend logout: %v", err)
return
defer resp.Body.Close()
}

defer resp.Body.Close()
if resp.StatusCode != 200 {
logger.Errorf("error while calling backend logout url, returned error code %v", resp.StatusCode)
}
Expand Down

0 comments on commit 92e7960

Please sign in to comment.