added timeout for http client

This commit is contained in:
ahmetlutfu
2023-12-06 23:07:52 +03:00
parent f78c958334
commit a849603d8b

View File

@@ -9,6 +9,7 @@ import (
"os"
"regexp"
"strings"
"time"
"ladder/pkg/ruleset"
@@ -181,7 +182,9 @@ func fetchSite(urlpath string, queries map[string]string) (string, *http.Request
}
// Fetch the site
client := &http.Client{}
client := &http.Client{
Timeout: time.Second * 15,
}
req, _ := http.NewRequest("GET", url, nil)
if rule.Headers.UserAgent != "" {