17755: Merge branch 'main' into 17755-add-singularity-to-compute-image
[arvados.git] / services / api / lib / load_param.rb
index a08b8b78a532d90fce3bb79deba6b6aabe3d5031..7119eb234800bf12e1460983ed7950ff9e0e4819 100644 (file)
@@ -56,7 +56,7 @@ module LoadParam
         raise ArgumentError.new("Invalid value for limit parameter")
       end
       @limit = [params[:limit].to_i,
-                Rails.configuration.max_items_per_response].min
+                Rails.configuration.API.MaxItemsPerResponse].min
     else
       @limit = DEFAULT_LIMIT
     end
@@ -151,7 +151,7 @@ module LoadParam
     when String
       begin
         @select = SafeJSON.load(params[:select])
-        raise unless @select.is_a? Array or @select.nil?
+        raise unless @select.is_a? Array or @select.nil? or !@select
       rescue
         raise ArgumentError.new("Could not parse \"select\" param as an array")
       end