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

The request with SetFileReader retry time great than 1 will has issues #770

Open
ybdx opened this issue Jan 24, 2024 · 1 comment
Open
Labels

Comments

@ybdx
Copy link

ybdx commented Jan 24, 2024

Below is the SetFileReader function code

func (r *Request) SetFileReader(param, fileName string, reader io.Reader) *Request {
	r.isMultiPart = true
	r.multipartFiles = append(r.multipartFiles, &File{
		Name:      fileName,
		ParamName: param,
		Reader:    reader,
	})
	return r
}

When we first use the reader to read content, the reader current index will move to the end. When we retry it again, the current index is in the end, we will lost the content from the start to the end. This means the second time we read the content is empty.

@jeevatkm
Copy link
Member

jeevatkm commented Mar 3, 2024

@ybdx Thanks for reporting it; I will analyze it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants