Skip to content

Commit

Permalink
Merge pull request #13 from guyinyou/master
Browse files Browse the repository at this point in the history
fix httpbody/NewFormBody.go
  • Loading branch information
andeya authored Apr 21, 2021
2 parents 8966055 + c47e766 commit b50c8d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion httpbody/httpbody.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewFormBody(values, files url.Values) (contentType string, bodyReader io.Re
if len(files) == 0 {
return "application/x-www-form-urlencoded", strings.NewReader(values.Encode()), nil
}
var rw = bytes.NewBuffer(make([]byte, 32*1024*len(files)))
var rw = bytes.NewBuffer(make([]byte, 0, 32*1024*len(files)))
var bodyWriter = multipart.NewWriter(rw)
var buf = make([]byte, 32*1024)
var fileWriter io.Writer
Expand Down

0 comments on commit b50c8d7

Please sign in to comment.