From 0a4d96a5e9c49241bac81b20f5ceb91a2f8d1537 Mon Sep 17 00:00:00 2001 From: demo Date: Thu, 28 May 2026 13:09:06 -0400 Subject: feat: check for missing https:// This isn't as easy as modifying the parsed URL after the fact. This Stack Overflow post has some hints: https://stackoverflow.com/q/46719948/4570292 --- main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index cd71cd1..f663005 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,11 @@ func main() { log.Fatalf("Invalid -depth argument: %d", *maxDepth) } + if !strings.HasPrefix(*startRawURL, "http://") && !strings.HasPrefix(*startRawURL, "https://") { + *startRawURL = "https://" + *startRawURL + fmt.Printf("start url: %s\n", *startRawURL) + } + startURL, err := url.Parse(*startRawURL) if err != nil { log.Fatal(err) -- cgit v1.2.3