Skip to content

Commit

Permalink
Cleanup a few comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jhiemstrawisc committed Oct 2, 2024
1 parent e360f20 commit daa3bf6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 51 deletions.
50 changes: 0 additions & 50 deletions client/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// }
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit daa3bf6

Please sign in to comment.