Skip to content

Commit

Permalink
ensure response is not nil before sanitizing (#27923)
Browse files Browse the repository at this point in the history
Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
  • Loading branch information
bhowe34 and akshya96 authored Aug 12, 2024
1 parent e31d1a8 commit cbc06c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions command/agentproxyshared/cache/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func ProxyHandler(ctx context.Context, logger hclog.Logger, proxier Proxier, inm
logical.RespondError(w, http.StatusInternalServerError, fmt.Errorf("failed to get the response: %w", err))
}
return
} else if resp == nil {
metrics.IncrCounter([]string{"agent", "proxy", "error"}, 1)
logical.RespondError(w, http.StatusInternalServerError, fmt.Errorf("failed to get the response: %w", err))
return
}

err = sanitizeAutoAuthTokenResponse(ctx, logger, inmemSink, req, resp)
Expand Down

0 comments on commit cbc06c0

Please sign in to comment.