Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

fix: check JWKS response body close for errcheck

wizardchen26af97df4219
diff --git a/internal/application/service/user.go b/internal/application/service/user.go
index 37bd6921d..9dc86c34d 100644
--- a/internal/application/service/user.go
+++ b/internal/application/service/user.go
@@ -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)