diff --git a/app/controllers/private_controller.rb b/app/controllers/private_controller.rb index a9c5bb9..7cca131 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