mirror of
https://github.com/lunchcat/sif.git
synced 2026-01-09 11:45:07 -08:00
cmd/scan: ignore 3xx redirects
This commit is contained in:
@@ -37,13 +37,16 @@ func Scan(url string, timeout time.Duration, threads int, logdir string) {
|
||||
|
||||
client := &http.Client{
|
||||
Timeout: timeout,
|
||||
CheckRedirect: func(req *http.Request, via []*http.Request) error {
|
||||
return http.ErrUseLastResponse
|
||||
},
|
||||
}
|
||||
|
||||
resp, err := client.Get(url + "/robots.txt")
|
||||
if err != nil {
|
||||
log.Debugf("Error: %s", err)
|
||||
}
|
||||
if resp.StatusCode != 404 {
|
||||
if resp.StatusCode != 404 && resp.StatusCode != 301 && resp.StatusCode != 302 && resp.StatusCode != 307 {
|
||||
scanlog.Infof("file [%s] found", statusstyle.Render("robots.txt"))
|
||||
|
||||
var robotsData []string
|
||||
|
||||
Reference in New Issue
Block a user