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

Merge pull request #532 from dotcloud/login_cookie_fix

- Registry: Fix issue when login in with a different user and trying to push
This commit is contained in:
Guillaume J. Charmes 2013-05-06 17:23:57 -07:00
commit e8853ec3a4
2 changed files with 3 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import (
"fmt"
"github.com/dotcloud/docker/auth"
"github.com/dotcloud/docker/rcli"
"github.com/shin-/cookiejar"
"io"
"log"
"net/http"
@ -217,6 +218,7 @@ func (srv *Server) CmdLogin(stdin io.ReadCloser, stdout rcli.DockerConn, args ..
if err != nil {
fmt.Fprintf(stdout, "Error: %s\r\n", err)
} else {
srv.runtime.graph.getHttpClient().Jar = cookiejar.NewCookieJar()
srv.runtime.authConfig = newAuthConfig
}
if status != "" {

View file

@ -69,7 +69,7 @@ func (graph *Graph) getRemoteHistory(imgId, registry string, token []string) ([]
func (graph *Graph) getHttpClient() *http.Client {
if graph.httpClient == nil {
graph.httpClient = new(http.Client)
graph.httpClient = &http.Client{}
graph.httpClient.Jar = cookiejar.NewCookieJar()
}
return graph.httpClient