// NewHTTPMirrorSource constructs and returns a new network mirror source with
// the given base URL. The relative URL offsets defined by the HTTP mirror
// protocol will be resolve relative to the given URL.
//
// The given URL must use the "https" scheme, or this function will panic.
// (When the URL comes from user input, such as in the CLI config, it's the
// UI/config layer's responsibility to validate this and return a suitable
// error message for the end-user audience.)
NewHTTPMirrorSource constructs and returns a new network mirror source with
the given base URL. The relative URL offsets defined by the HTTP mirror
protocol will be resolve relative to the given URL.

The given URL must use the "https" scheme, or this function will panic.
(When the URL comes from user input, such as in the CLI config, it's the
UI/config layer's responsibility to validate this and return a suitable
error message for the end-user audience.)
// NewHTTPMirrorSource constructs and returns a new network mirror source with // the given base URL . The relative URL offsets defined by the HTTP mirror // protocol will be resolve relative to the given URL . // // The given URL must use the " https " scheme or this function will panic . // ( When the URL comes from user input such as in the CLI config it ' s the // UI / config layer ' s responsibility to validate this and return a suitable // error message for the end - user audience . )
func NewHTTPMirrorSource(baseURL *url.URL, creds svcauth.CredentialsSource) *HTTPMirrorSource {
	httpClient := httpclient.New()
	httpClient.Timeout = requestTimeout
	httpClient.CheckRedirect = func(req *http.Request, via []*http.Request) error {
		if len(via) > 5 {
			return fmt.Errorf("too many redirects")
		}
		return nil
	}
	return newHTTPMirrorSourceWithHTTPClient(baseURL, creds, httpClient)
}
func NewHTTPMirrorSource ( baseURL * url . URL , creds svcauth . CredentialsSource ) * HTTPMirrorSource { httpClient := httpclient . New ( ) httpClient . Timeout = requestTimeout httpClient . CheckRedirect = func ( req * http . Request , via [ ] * http . Request ) error { if len ( via ) > 5 { return fmt . Errorf ( " " ) } return nil } return newHTTPMirrorSourceWithHTTPClient ( baseURL , creds , httpClient ) }
NewHTTPMirrorSource constructs and returns a new network mirror source with
the given base URL.
NewHTTPMirrorSource constructs and returns a new network mirror source with the given base URL .
// If we get redirected more than five times we'll assume we're // in a redirect loop and bail out, rather than hanging forever.