mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
fix(server): return ErrMissingFile when MultipartForm.File is nil (#2260)
RequestCtx.FormFile previously returned (nil, nil) when the parsed multipart form had a nil File map: the code returned the err variable from the preceding successful MultipartForm() call, which is always nil at that point. Callers checking `if err != nil` proceeded with a nil *multipart.FileHeader, causing nil pointer dereferences downstream. Return ErrMissingFile instead, matching the existing semantics for the missing-key case immediately below. Fixes #2235. Signed-off-by: Y.Horie <u5.horie@gmail.com>
This commit is contained in:
Reference in New Issue
Block a user