Skip to content

Commit

Permalink
Update temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongseup committed Dec 14, 2023
1 parent 45d5c83 commit 076b6cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion td2/rpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,18 @@ func guessPublicEndpoint(u string) string {
}

func getStatusWithEndpoint(ctx context.Context, u string) (string, bool, error) {
queryPath := fmt.Sprintf("%s/status", u)
// Parse the URL
parsedURL, err := url.Parse(u)
if err != nil {
return "", false, err
}

// Check if the scheme is 'tcp' and modify to 'http'
if parsedURL.Scheme == "tcp" {
parsedURL.Scheme = "http"
}

queryPath := fmt.Sprintf("%s/status", parsedURL.String())
req, err := http.NewRequestWithContext(ctx, http.MethodGet, queryPath, nil)
if err != nil {
return "", false, err
Expand Down

0 comments on commit 076b6cb

Please sign in to comment.