-
Notifications
You must be signed in to change notification settings - Fork 112
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
Optimize Image upload to avoid buffering. Add cluster related fields in image upload resource & data source for PC #432
Optimize Image upload to avoid buffering. Add cluster related fields in image upload resource & data source for PC #432
Conversation
|
||
// Set req.ContentLength and req.GetBody as internally there is no implementation of such for os.File type reader | ||
// http.NewRequest() only sets this values for types - bytes.Buffer, bytes.Reader and strings.Reader | ||
// Refer https://github.com/golang/go/blob/a0f77e56b7a7ecb92dca3e2afdd56ee773c2cb07/src/net/http/request.go#L896 |
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.
Nit: While this is true for those data types, it doesn't seem necessary when using an *os.File, see my example in the issue -- it uploaded perfectly fine without pre-emptively specifying content-length. That being said, I totally support not relying on default behavior here.
Edit: while I did get uploads without doing that, it wasn't working how I thought. ignore me. I agreed with explicitly setting it anyway
/ok-to-test
|
New additions: