diff options
| author | demo <demo@antix1> | 2026-05-28 13:09:06 -0400 |
|---|---|---|
| committer | demo <demo@antix1> | 2026-05-28 13:09:06 -0400 |
| commit | 0a4d96a5e9c49241bac81b20f5ceb91a2f8d1537 (patch) | |
| tree | c7e5b5591f271c0bfb9c62b93e6b504555fc2a2e /main.go | |
| parent | c2f1c9a6eb8230e8fffd633d1f85cde80764c5b3 (diff) | |
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
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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) |
