Skip to content

Commit 6069c74

Browse files
author
Michael Hoisie
committed
Handle non-file fields in multipart form data
1 parent c2eece4 commit 6069c74

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

request.go

+10
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@ func (r *Request) ParseParams() (err os.Error) {
196196
if isfile {
197197
parts = bytes.Split(rest, strings.Bytes("\r\n--"+boundary+"--\r\n"), 0)
198198
r.Files[name] = parts[0]
199+
} else {
200+
_, ok := r.Params[name]
201+
if !ok {
202+
r.Params[name] = []string{}
203+
}
204+
curlen := len(r.Params[name])
205+
newlst := make([]string, curlen+1)
206+
copy(newlst, r.Params[name])
207+
newlst[curlen] = string(rest)
208+
r.Params[name] = newlst
199209
}
200210
}
201211
default:

0 commit comments

Comments
 (0)