We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I thought it would be like this.
grequests.RequestOptions{ RedirectLimit: -1, }
But this code does not disable redirect,please tell me how to disable redirect, thanks~~~
The text was updated successfully, but these errors were encountered:
maybe have some simple code to disable redirect?
Sorry, something went wrong.
utils.go
func addRedirectFunctionality(client *http.Client, ro *RequestOptions) { if client.CheckRedirect != nil { return } client.CheckRedirect = func(req *http.Request, via []*http.Request) error { // here is new code if ro.RedirectLimit == -1{ return http.ErrUseLastResponse } //over if ro.RedirectLimit == 0 { ro.RedirectLimit = RedirectLimit } if len(via) >= ro.RedirectLimit { return ErrRedirectLimitExceeded } if ro.SensitiveHTTPHeaders == nil { ro.SensitiveHTTPHeaders = SensitiveHTTPHeaders } for k, vv := range via[0].Header { // Is this a sensitive header? if _, found := ro.SensitiveHTTPHeaders[k]; found { continue } for _, v := range vv { req.Header.Add(k, v) } } return nil } }
I actually just found out that you posted this issue. I created a pull request #75 that fixes this. Hopefully @levigross will see it the same way.
No branches or pull requests
I thought it would be like this.
But this code does not disable redirect,please tell me how to disable redirect, thanks~~~
The text was updated successfully, but these errors were encountered: