Merge pull request #2952 from codeaholics/2126-registry-close-wait

Closing HTTP connection after Registry ping
This commit is contained in:
Guillaume J. Charmes 2013-11-29 14:21:52 -08:00
commit e1278e9ec2

View file

@ -47,6 +47,8 @@ func pingRegistryEndpoint(endpoint string) error {
if err != nil {
return err
}
defer resp.Body.Close()
if resp.Header.Get("X-Docker-Registry-Version") == "" {
return errors.New("This does not look like a Registry server (\"X-Docker-Registry-Version\" header not found in the response)")
}