From b24648c0db9ea709937e808f4758644189e4e004 Mon Sep 17 00:00:00 2001 From: BBD-YZZ <969178484@qq.com> Date: Thu, 26 Oct 2023 16:38:11 +0800 Subject: [PATCH] second --- check_demo/start_poc.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/check_demo/start_poc.go b/check_demo/start_poc.go index 447fc70..a7fcfd6 100644 --- a/check_demo/start_poc.go +++ b/check_demo/start_poc.go @@ -319,14 +319,6 @@ func readFile(path string) []string { } func checkUrl(client *http.Client, url string, timeout time.Duration) bool { - // tr := &http.Transport{ - // TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, - // } - - // client := http.Client{ - // Transport: tr, - // Timeout: timeout, - // } resp, err := client.Get(url) if err != nil { @@ -341,7 +333,7 @@ func checkUrl(client *http.Client, url string, timeout time.Duration) bool { func Put_URL(client *http.Client, ch chan string, path string, ctx context.Context) { url := readFile(path) for _, v := range url { - if !strings.HasPrefix(v, "http://") || !strings.HasPrefix(v, "https://") { + if !strings.HasPrefix(v, "http://") && !strings.HasPrefix(v, "https://") { v = strings.Join([]string{"http://", v}, "") } if checkUrl(client, v, time.Second*2) {