ensure response is not nil before sanitizing (#27923)

Co-authored-by: akshya96 <87045294+akshya96@users.noreply.github.com>
This commit is contained in:
Brian Howe
2024-08-12 14:48:48 -05:00
committed by GitHub
parent e31d1a8b1e
commit cbc06c0856

View File

@@ -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)