Skip files with empty #size in ParamParser, fixes #309 (#333)

This commit is contained in:
Sijawusz Pur Rahnama 2017-03-12 18:30:30 +01:00 committed by Serdar Dogruyol
parent e0511743b1
commit d0c034b911

View file

@ -67,7 +67,7 @@ module Kemal
private def parse_file_upload private def parse_file_upload
HTTP::FormData.parse(@request) do |upload| HTTP::FormData.parse(@request) do |upload|
next unless upload next unless upload && upload.size
filename = upload.filename filename = upload.filename
if !filename.nil? if !filename.nil?
@files[upload.name] = FileUpload.new(upload: upload) @files[upload.name] = FileUpload.new(upload: upload)