Browse code

prompt a cli login if receive 401 from registry v2 auth server

Signed-off-by: tgic <farmer1992@gmail.com>

tgic authored on 2015/06/17 20:28:13
Showing 1 changed files
... ...
@@ -132,6 +132,7 @@ func (cli *DockerCli) clientRequestAttemptLogin(method, path string, in io.Reade
132 132
 			// we may need to change the status code.
133 133
 			if strings.Contains(err.Error(), "Authentication is required") ||
134 134
 				strings.Contains(err.Error(), "Status 401") ||
135
+				strings.Contains(err.Error(), "401 Unauthorized") ||
135 136
 				strings.Contains(err.Error(), "status code 401") {
136 137
 				statusCode = http.StatusUnauthorized
137 138
 			}