Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

registry.Ping() may need to check response.statuscode #86

Open
aiyijing opened this issue Sep 1, 2021 · 0 comments
Open

registry.Ping() may need to check response.statuscode #86

aiyijing opened this issue Sep 1, 2021 · 0 comments

Comments

@aiyijing
Copy link

aiyijing commented Sep 1, 2021

when use http protocol to connect https registry,it will return 302 response.
here would better check statuscode and raise Error

func (r *Registry) Ping() error {
url := r.url("/v2/")
r.Logf("registry.ping url=%s", url)
resp, err := r.Client.Get(url)
if resp != nil {
defer resp.Body.Close()
}
return err
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant