From d0c034b911e9cb891a9e6eee3a68ba7d77c34499 Mon Sep 17 00:00:00 2001 From: Sijawusz Pur Rahnama Date: Sun, 12 Mar 2017 18:30:30 +0100 Subject: [PATCH] Skip files with empty #size in ParamParser, fixes #309 (#333) --- src/kemal/param_parser.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kemal/param_parser.cr b/src/kemal/param_parser.cr index f95fb24..6c70194 100644 --- a/src/kemal/param_parser.cr +++ b/src/kemal/param_parser.cr @@ -67,7 +67,7 @@ module Kemal private def parse_file_upload HTTP::FormData.parse(@request) do |upload| - next unless upload + next unless upload && upload.size filename = upload.filename if !filename.nil? @files[upload.name] = FileUpload.new(upload: upload)