Say a refused form carries too many pieces, which is what is counted

This commit is contained in:
2026-10-09 12:44:05 -07:00
parent cba7649b6b
commit c54031ff99
+1 -1
View File
@@ -714,7 +714,7 @@ func readForm(c fiber.Ctx, media string, body []byte, names map[string]bool) (fo
fd := formData{values: map[string][]string{}, files: map[string][]File{}}
if m, _, _ := mime.ParseMediaType(media); m != mimeMultipart {
if bytes.Count(body, []byte("&")) >= maxFormFields {
return fd, fmt.Errorf("a form carries more than %d fields", maxFormFields)
return fd, fmt.Errorf("a form carries more than %d pieces between its '&'s", maxFormFields)
}
var args fasthttp.Args
args.ParseBytes(body)