You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0a094e0
Browse filesBrowse the repository at this point in the historyBrowse files
Fix(curl): surface auth errors and avoid panic on nil HTTP response (#3838)
MakeCurlRequest assumed that a non-nil error always came with an HTTP
response (e.g. a 4xx/5xx from the API). That assumption breaks when the
request fails before reaching the API — for example a token refresh /
client-credentials authentication failure in the UAA request wrapper,
which returns an error with a nil *http.Response.
In that case:
- Without --fail, the error was swallowed and cf curl printed empty
output, giving the user no indication anything went wrong.
- With --fail, the code dereferenced httpResponse.StatusCode on the nil
response and panicked.
Only surface CurlExit22Error when an HTTP response is actually present;
when the response is nil, return the underlying error directly so the
user sees a real message (e.g. "Bad credentials") and cf curl exits
cleanly instead of panicking. Existing behavior for real HTTP error
responses (print body by default, fail only with --fail) is unchanged.
Also, sync .grype.yaml exclusions with main so check-cves ignores test fixtures
Signed-off-by: Prem Kumar Kalle <prem.kalle@broadcom.com>
0 commit comments