fix: check JWKS response body close for errcheck

main
wizardchen 2026-09-01 11:16:29 +08:00 committed by lyingbug
parent 5a7683cf38
commit 26af97df42
1 changed files with 1 additions and 1 deletions

View File

@ -1817,7 +1817,7 @@ func (s *userService) fetchOIDCJWKS(ctx context.Context, jwksURI string) (*oidcJ
if err != nil {
return nil, err
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
_, _ = io.Copy(io.Discard, io.LimitReader(resp.Body, 2048))
return nil, fmt.Errorf("JWKS request failed: status=%d", resp.StatusCode)