Fix off-by-one in file & field count
This commit is contained in:
parent
d3b16438c9
commit
fb46235530
|
@ -409,13 +409,13 @@ fn count<T, E>(
|
|||
match content {
|
||||
MultipartContent::File(_) => {
|
||||
file_count += 1;
|
||||
if file_count >= form.max_files {
|
||||
if file_count > form.max_files {
|
||||
return Err(Error::FileCount);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
field_count += 1;
|
||||
if field_count >= form.max_fields {
|
||||
if field_count > form.max_fields {
|
||||
return Err(Error::FieldCount);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue