From 655c6b65d59c37be310c4c48f0b4c2cad7939a9c Mon Sep 17 00:00:00 2001 From: f Date: Fri, 1 Jul 2022 14:43:30 -0300 Subject: [PATCH] procesar todas las urls a veces las urls vienen como arrays, con lo que no hay que procesarlas. --- app/controllers/stats_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index cccdb8b6..c2c7bc58 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -133,7 +133,8 @@ class StatsController < ApplicationController def normalized_urls @normalized_urls ||= begin - urls = params.permit(:urls).try(:[], :urls)&.split("\n")&.map(&:strip)&.select(&:present?)&.select do |uri| + urls = params[:urls].is_a?(Array) ? params[:urls] : params[:urls]&.split("\n") + urls = urls&.map(&:strip)&.select(&:present?)&.select do |uri| uri.start_with? 'https://' end