mirror of
https://github.com/golang/go
synced 2024-11-21 22:24:40 -07:00
net/http: enhance cloneMultipartForm by initializing Value with File length
This commit is contained in:
parent
f2d118fd5f
commit
a9683ba9a7
@ -68,7 +68,7 @@ func cloneMultipartForm(f *multipart.Form) *multipart.Form {
|
|||||||
Value: (map[string][]string)(Header(f.Value).Clone()),
|
Value: (map[string][]string)(Header(f.Value).Clone()),
|
||||||
}
|
}
|
||||||
if f.File != nil {
|
if f.File != nil {
|
||||||
m := make(map[string][]*multipart.FileHeader)
|
m := make(map[string][]*multipart.FileHeader, len(f.File))
|
||||||
for k, vv := range f.File {
|
for k, vv := range f.File {
|
||||||
vv2 := make([]*multipart.FileHeader, len(vv))
|
vv2 := make([]*multipart.FileHeader, len(vv))
|
||||||
for i, v := range vv {
|
for i, v := range vv {
|
||||||
|
Loading…
Reference in New Issue
Block a user