sync: allow HTTP redirects when GETing signatures blobs

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
Petu Eusebiu 2022-05-25 13:23:06 +03:00 committed by Ramkumar Chinchani
parent aeb8a5da39
commit bd730150a8
2 changed files with 4 additions and 1 deletions

View File

@ -28,7 +28,8 @@ import (
)
const (
SyncBlobUploadDir = ".sync"
SyncBlobUploadDir = ".sync"
httpMaxRedirectsCount = 15
)
// /v2/_catalog struct.

View File

@ -251,6 +251,8 @@ func getHTTPClient(regCfg *RegistryConfig, upstreamURL string, credentials Crede
client.SetBasicAuth(credentials.Username, credentials.Password)
}
client.SetRedirectPolicy(resty.FlexibleRedirectPolicy(httpMaxRedirectsCount))
return client, registryURL, nil
}