1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #13986 from tg123/master

prompt a cli login if receive 401 from registry v2 auth server
This commit is contained in:
Jessie Frazelle 2015-07-10 15:33:42 -07:00
commit ff8cef3326

View file

@ -149,6 +149,7 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
// we may need to change the status code.
if strings.Contains(err.Error(), "Authentication is required") ||
strings.Contains(err.Error(), "Status 401") ||
strings.Contains(err.Error(), "401 Unauthorized") ||
strings.Contains(err.Error(), "status code 401") {
serverResp.statusCode = http.StatusUnauthorized
}