From 9829398b4f50b87ad1fd39646bef5ba67b067056 Mon Sep 17 00:00:00 2001 From: man13 <man13@inf.ufpr.br> Date: Tue, 22 Mar 2016 11:47:07 -0300 Subject: [PATCH] fixing chuncks controller mime types validation Signed-off-by: man13 <man13@inf.ufpr.br> --- app/controllers/chunks_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/chunks_controller.rb b/app/controllers/chunks_controller.rb index be663c6f..460eee16 100644 --- a/app/controllers/chunks_controller.rb +++ b/app/controllers/chunks_controller.rb @@ -113,7 +113,9 @@ class ChunksController < ApplicationController end def valid_mime_type? - @learning_object.object_type.mime_types.map(&:extension).include? resumable_file_extension + mime_types = @learning_object.object_type.mime_types.map(&:extension) + return true if mime_types.empty? + mime_types.include? resumable_file_extension end # Never trust parameters from the scary internet, only allow the white list through. def chunks_params -- GitLab