提交 60f6d8ec 编写于 作者: G GitLab Bot

Add latest changes from gitlab-org/security/gitlab@12-9-stable-ee

上级 58a7bab6
......@@ -48,7 +48,7 @@ class UploadedFile
return if path.blank? && remote_id.blank?
file_path = nil
if path
if path.present?
file_path = File.realpath(path)
paths = Array(upload_paths) << Dir.tmpdir
......
......@@ -59,6 +59,16 @@ describe UploadedFile do
expect(subject.sha256).to eq('sha256')
expect(subject.remote_id).to eq('remote_id')
end
it 'handles a blank path' do
params['file.path'] = ''
# Not a real file, so can't determine size itself
params['file.size'] = 1.byte
expect { described_class.from_params(params, :file, upload_path) }
.not_to raise_error
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册