Skip to content

Commit

Permalink
second
Browse files Browse the repository at this point in the history
BBD-YZZ committed Oct 26, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent d3c4e82 commit b24648c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions check_demo/start_poc.go
Original file line number Diff line number Diff line change
@@ -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) {

0 comments on commit b24648c

Please sign in to comment.