Update pkg/registry/fallback.go

Signed-off-by: Terry Howe <terrylhowe@gmail.com>
pull/30296/head
Terry Howe 7 months ago
parent 674e882c88
commit 1435ec7c77

@ -58,6 +58,8 @@ func (t *fallbackTransport) RoundTrip(req *http.Request) (*http.Response, error)
return t.Base.RoundTrip(req) return t.Base.RoundTrip(req)
} }
resp, err := t.Base.RoundTrip(req) resp, err := t.Base.RoundTrip(req)
// We are falling back to http here for backward compatibility with Helm v3.
// ORAS v1 provided fallback automatically, but ORAS v2 does not.
if err != nil && req.URL.Scheme == "https" { if err != nil && req.URL.Scheme == "https" {
if tlsErr, ok := err.(tls.RecordHeaderError); ok { if tlsErr, ok := err.(tls.RecordHeaderError); ok {
if string(tlsErr.RecordHeader[:]) == "HTTP/" { if string(tlsErr.RecordHeader[:]) == "HTTP/" {

Loading…
Cancel
Save