From 5e6355d1828441fe6d5ff4cd814825e05213b2c9 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 22 Mar 2013 10:22:22 -0700 Subject: [PATCH] Fix the lookup method --- registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry.go b/registry.go index 318a65a0e7..a458817bb2 100644 --- a/registry.go +++ b/registry.go @@ -80,14 +80,14 @@ func (graph *Graph) getRemoteHistory(imgId string, authConfig *auth.AuthConfig) // Check if an image exists in the Registry func (graph *Graph) LookupRemoteImage(imgId string, authConfig *auth.AuthConfig) bool { - client := &http.Client{} + rt := &http.Transport{Proxy: http.ProxyFromEnvironment} req, err := http.NewRequest("GET", REGISTRY_ENDPOINT+"/images/"+imgId+"/json", nil) if err != nil { return false } req.SetBasicAuth(authConfig.Username, authConfig.Password) - res, err := client.Do(req) + res, err := rt.RoundTrip(req) if err != nil || res.StatusCode != 307 { return false }