mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-13 09:48:33 -04:00
Add force-non-ssl to registry operations (#102)
This commit is contained in:
parent
83c621c4a7
commit
383e4f7d48
1
main.go
1
main.go
|
@ -115,6 +115,7 @@ func createRegistryClient(domain string) (*registry.Registry, error) {
|
|||
Insecure: insecure,
|
||||
Debug: debug,
|
||||
SkipPing: skipPing,
|
||||
NonSSL: forceNonSSL,
|
||||
Timeout: timeout,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -44,6 +44,7 @@ type Opt struct {
|
|||
Insecure bool
|
||||
Debug bool
|
||||
SkipPing bool
|
||||
NonSSL bool
|
||||
Timeout time.Duration
|
||||
Headers map[string]string
|
||||
}
|
||||
|
@ -67,7 +68,11 @@ func newFromTransport(auth types.AuthConfig, transport http.RoundTripper, opt Op
|
|||
url := strings.TrimSuffix(auth.ServerAddress, "/")
|
||||
|
||||
if !reProtocol.MatchString(url) {
|
||||
url = "https://" + url
|
||||
if !opt.NonSSL {
|
||||
url = "https://" + url
|
||||
} else {
|
||||
url = "http://" + url
|
||||
}
|
||||
}
|
||||
|
||||
tokenTransport := &TokenTransport{
|
||||
|
|
Loading…
Reference in a new issue