|
|
@@ -232,11 +232,13 @@ func (c *Context) query(key string) (string, bool) {
|
|
|
func (c *Context) postForm(key string) (string, bool) {
|
|
|
req := c.Request
|
|
|
req.ParseMultipartForm(32 << 20) // 32 MB
|
|
|
- if values, ok := req.PostForm[key]; ok && len(values) > 0 {
|
|
|
+ if values := req.PostForm[key]; len(values) > 0 {
|
|
|
return values[0], true
|
|
|
}
|
|
|
- if values, ok := req.MultipartForm.Value[key]; ok && len(values) > 0 {
|
|
|
- return values[0], true
|
|
|
+ if req.MultipartForm != nil && req.MultipartForm.File != nil {
|
|
|
+ if values := req.MultipartForm.Value[key]; len(values) > 0 {
|
|
|
+ return values[0], true
|
|
|
+ }
|
|
|
}
|
|
|
return "", false
|
|
|
}
|