-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 Bug: retry scrape will lost POST requestData #794
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea to limit the API to seekable bodies.
However, we might try to rewind the body if it happens to implement io.Seeker
. And it might be a good idea to make Retry
retry an error if doesn't.
是个好主意
|
Otherwise, looks good |
When calling Request.Retry, and request has a body (e.g. POST form or file upload), try to rewind it. If it's not seekable, return ErrRetryBodyUnSeekable error.
And thank you! |
when retry scrape
requestData will loss in http.NewRequest
so Seek requestData before scrape.NewRequest