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
In pkg/binary/download.go, the HTTP status switch has an empty case http.StatusForbidden: that silently falls through to no error. Go switch cases do not fall through, so a 403 matches the empty case, returns nil, and the download proceeds to read the body of a forbidden response as if it succeeded — producing a corrupt/garbage binary or a confusing downstream error instead of a clear "forbidden" message.
Summary
In
pkg/binary/download.go, the HTTP status switch has an emptycase http.StatusForbidden:that silently falls through to no error. Goswitchcases do not fall through, so a403matches the empty case, returnsnil, and the download proceeds to read the body of a forbidden response as if it succeeded — producing a corrupt/garbage binary or a confusing downstream error instead of a clear "forbidden" message.Expected
A
403should return a clear error (e.g.Forbidden/Unauthorized), not be treated as a successful download.Notes
main; spotted during the review of fix(state): keep relative file paths on save; clearer install errors #159 but left out of scope to keep that PR focused.StatusForbiddenwithStatusUnauthorized(i.e.case http.StatusForbidden, http.StatusUnauthorized:).403viahttptestand asserts a non-nil error.