Skip to content

Commit

Permalink
Add default protocol (http)
Browse files Browse the repository at this point in the history
  • Loading branch information
danroc committed Mar 17, 2019
1 parent f71b1a4 commit bea7142
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions htp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"net/http"
"net/http/httptrace"
"os"
"strings"
"time"
)

Expand All @@ -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
Expand Down

0 comments on commit bea7142

Please # to comment.