gin/binding
adityajai119 fc07a2296b fix(binding): leave file fields unset for an empty multipart file part
Browsers send a file input with no file selected as a part with
filename="" and an empty body. mime/multipart stores that part as a
form value, so multipartRequest.TrySet found no files and fell back to
setByForm, which bound a non-nil empty multipart.FileHeader to pointer
fields and one empty entry to slices and arrays. binding:"required"
then passed although no file was uploaded.

Leave file-typed fields unset when the request has no files for the
key, so an empty file part binds like a missing one.

Fixes #2376
2026-11-12 17:45:14 +05:30
..
2025-04-12 00:00:59 +08:00
2022-05-30 15:16:10 +08:00