remote: Fix HTTPFallback fails when pushing manifest

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga
2024-04-03 00:02:30 +09:00
parent 9fc0b64bc4
commit 63d5573a38
2 changed files with 58 additions and 2 deletions

View File

@@ -732,6 +732,14 @@ func (f HTTPFallback) RoundTrip(r *http.Request) (*http.Response, error) {
plainHTTPRequest := *r
plainHTTPRequest.URL = &plainHTTPUrl
if r.Body != nil && r.GetBody != nil {
body, err := r.GetBody()
if err != nil {
return nil, err
}
plainHTTPRequest.Body = body
}
return f.RoundTripper.RoundTrip(&plainHTTPRequest)
}