From daa3bf61522e05731eec7ce84c72b4daf8dda90f Mon Sep 17 00:00:00 2001 From: Justin Hiemstra Date: Wed, 2 Oct 2024 15:37:37 +0000 Subject: [PATCH] Cleanup a few comments --- client/main_test.go | 50 --------------------------------------------- config/config.go | 2 +- 2 files changed, 1 insertion(+), 51 deletions(-) diff --git a/client/main_test.go b/client/main_test.go index 9889f5c81..489c09016 100644 --- a/client/main_test.go +++ b/client/main_test.go @@ -496,53 +496,3 @@ func TestParseRemoteAsPUrl(t *testing.T) { }) } } - -// func ParseRemoteAsPUrl(ctx context.Context, rp string) (*pelican_url.PelicanURL, error) { -// pUrl := &pelican_url.PelicanURL{} - -// rpUrl, err := url.Parse(rp) -// if err != nil { -// return nil, errors.Wrap(err, "failed to parse remote path") -// } - -// // Set up options that get passed from Parse --> PopulateFedInfo and may be used when querying the Director -// client := &http.Client{Transport: config.GetTransport()} -// pOptions := []pelican_url.ParseOption{pelican_url.ShouldDiscover(true)} -// dOptions := []pelican_url.DiscoveryOption{pelican_url.UseCached(true), pelican_url.WithContext(ctx), pelican_url.WithClient(client), pelican_url.WithUserAgent(getUserAgent(""))} - -// // If we have no scheme, we'll end up assuming a Pelican url. We need to figure out which discovery endpoint to use. -// if rpUrl.Scheme == "" { -// fedInfo, err := config.GetFederation(ctx) -// if err != nil { -// return nil, errors.Wrap(err, "failed to get configured federation info") -// } - -// // First try to use the configured discovery endpoint -// if fedInfo.DiscoveryEndpoint != "" { -// discoveryUrl, err := url.Parse(fedInfo.DiscoveryEndpoint) -// if err != nil { -// return nil, errors.Wrap(err, "failed to parse federation discovery endpoint") -// } -// dOptions = append(dOptions, pelican_url.WithDiscoveryUrl(discoveryUrl)) -// } else if fedInfo.DirectorEndpoint != "" { -// // If we don't have a discovery endpoint, try to use the director endpoint -// discoveryUrl, err := url.Parse(fedInfo.DiscoveryEndpoint) -// if err != nil { -// return nil, errors.Wrap(err, "failed to parse federation discovery endpoint") -// } - -// dOptions = append(dOptions, pelican_url.WithDiscoveryUrl(discoveryUrl)) -// } -// } - -// pUrl, err = pelican_url.Parse( -// rp, -// pOptions, -// dOptions, -// ) -// if err != nil { -// return nil, err -// } - -// return pUrl, nil -// } diff --git a/config/config.go b/config/config.go index b148dd403..651643611 100644 --- a/config/config.go +++ b/config/config.go @@ -318,7 +318,7 @@ func GetAllPrefixes() []ConfigPrefix { return prefixes } -// We can't parse a schemeless hostname when there's a port, so check for a scheme and add one if non exists. +// We can't parse a schemeless hostname when there's a port, so check for a scheme and add one if none exists. func wrapWithHttpsIfNeeded(urlStr string) string { if len(urlStr) > 0 && !strings.HasPrefix(urlStr, "http://") && !strings.HasPrefix(urlStr, "https://") { urlStr = "https://" + urlStr