We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I was reviewing code in #1015, I found in master, the code following has incorrect logic:
// RegistryLogin authenticates the server with a given registry to login. func (client *APIClient) RegistryLogin(ctx context.Context, auth *types.AuthConfig) (*types.AuthResponse, error) { resp, err := client.post(ctx, "/auth", nil, auth, nil) if err != nil || resp.StatusCode == http.StatusUnauthorized { return nil, err } authResp := &types.AuthResponse{} err = decodeBody(authResp, resp.Body) ensureCloseReader(resp) return authResp, err
In code above, when err == nil, and resp.StatusCode == http.StatusUnauthorized, code will return nil, nil. I don't think this is reasonable. @Ace-Tang
The text was updated successfully, but these errors were encountered:
bugfix: fix client login logic
0a41769
remove statuscode compare, since if login get unauthorized error, http post will get a nil Response. Fixes: #1030.
Ace-Tang
Successfully merging a pull request may close this issue.
Ⅰ. Issue Description
When I was reviewing code in #1015, I found in master, the code following has incorrect logic:
In code above, when err == nil, and resp.StatusCode == http.StatusUnauthorized, code will return nil, nil. I don't think this is reasonable. @Ace-Tang
The text was updated successfully, but these errors were encountered: