From 475c393f46334e039a56a0bd43e4a070d11d898b Mon Sep 17 00:00:00 2001 From: f Date: Sat, 29 Aug 2020 19:51:56 -0300 Subject: [PATCH] =?UTF-8?q?no=20fallar=20si=20el=20sitio=20todav=C3=ADa=20?= =?UTF-8?q?no=20se=20gener=C3=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/private_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/private_controller.rb b/app/controllers/private_controller.rb index a9c5bb96..7cca1319 100644 --- a/app/controllers/private_controller.rb +++ b/app/controllers/private_controller.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Gestiona las versiones privadas de los sitios. Solo se puede acceder # con una cuenta class PrivateController < ApplicationController @@ -18,7 +20,7 @@ class PrivateController < ApplicationController return end - if deploy_private + if deploy_private && File.exist?(path) send_file path, disposition: 'inline' else head :not_found @@ -69,7 +71,7 @@ class PrivateController < ApplicationController 'index.html' else '.' + params[:format].to_s - end + end @file = @file.gsub('..', '/').gsub('./', '').squeeze('/') end