Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix : retry redirect to AlreadyVisitedUrl will loop error #826

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
retry redirect to AlreadyVisitedUrl will loop error
Shinku-Chen committed Apr 8, 2024
commit b27534c4b657e8ccd8494dd9ceaf9f7dbe7ad338
3 changes: 1 addition & 2 deletions colly.go
Original file line number Diff line number Diff line change
@@ -653,8 +653,7 @@ func (c *Collector) scrape(u, method string, depth int, requestData io.Reader, c
}
// note: once 1.13 is minimum supported Go version,
// replace this with http.NewRequestWithContext
//c.Context = context.WithValue(c.Context, CheckRevisitKey, checkRevisit)
req = req.WithContext(c.Context)
req = req.WithContext(context.WithValue(req.WithContext(c.Context).Context(), CheckRevisitKey, checkRevisit))
if err := c.requestCheck(parsedURL, method, req.GetBody, depth, checkRevisit); err != nil {
return err
}