Skip to content

Commit a9683ba

Browse files
author
1911860538
committed
net/http: enhance cloneMultipartForm by initializing Value with File length
1 parent f2d118f commit a9683ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/http/clone.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func cloneMultipartForm(f *multipart.Form) *multipart.Form {
6868
Value: (map[string][]string)(Header(f.Value).Clone()),
6969
}
7070
if f.File != nil {
71-
m := make(map[string][]*multipart.FileHeader)
71+
m := make(map[string][]*multipart.FileHeader, len(f.File))
7272
for k, vv := range f.File {
7373
vv2 := make([]*multipart.FileHeader, len(vv))
7474
for i, v := range vv {

0 commit comments

Comments
 (0)