diff --git a/htp.go b/htp.go index f5a0c39..bc69d84 100644 --- a/htp.go +++ b/htp.go @@ -8,6 +8,7 @@ import ( "net/http" "net/http/httptrace" "os" + "strings" "time" ) @@ -28,6 +29,10 @@ func main() { layout := flag.String("f", UnixDateMilli, "Time format layout") flag.Parse() + if strings.Index(*host, "://") == -1 { + *host = "http://" + *host + } + logger := log.New(os.Stderr, "", 0) client := http.DefaultClient client.CheckRedirect = noRedirect