Closing connection after ping

master
cressie176 2013-11-29 10:02:53 +00:00 committed by Danny Yates
parent 94472f9dad
commit c86cee210f
1 changed files with 2 additions and 0 deletions

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)")
}