Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/v1/remote/transport/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ func pingSingle(ctx context.Context, reg name.Registry, t http.RoundTripper, sch
resp.Body.Close()
}()

// Check actual registry scheme detected, in case of redirecting to different scheme,
// update the scheme so subsequent logic (and the returned Challenge) reflects it.
if resp.Request != nil && resp.Request.URL != nil && resp.Request.URL.Scheme != "" {
scheme = resp.Request.URL.Scheme
}

insecure := scheme == "http"

switch resp.StatusCode {
Expand Down