Skip to content

Commit

Permalink
Properly utilize url scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
Kashkovsky committed Apr 15, 2022
1 parent bfa601a commit b57054b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"net/url"
"regexp"
"strconv"
"strings"
"time"
)

Expand Down Expand Up @@ -75,7 +76,8 @@ func (t *Tester) tcp(url *url.URL) int {
func (t *Tester) http(url *url.URL) (status string, duration time.Duration) {
tp := NewTransport(t.requestTimeout)
client := http.Client{Transport: tp, Timeout: t.requestTimeout}
res, err := client.Get("http://" + url.Host)
addr := strings.Replace(url.String(), "tcp", "http", 1)
res, err := client.Get(addr)
duration = tp.Duration()
if err == nil {
status = res.Status
Expand Down

0 comments on commit b57054b

Please sign in to comment.