From e69a1aceb11857a8977e63c707f846ebe49608b9 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 5 Sep 2019 15:53:58 -0300 Subject: [PATCH] =?UTF-8?q?eliminar=20c=C3=B3digo=20muerto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/sites_controller.rb | 22 ---------------------- app/policies/site_policy.rb | 4 ---- 2 files changed, 26 deletions(-) diff --git a/app/controllers/sites_controller.rb b/app/controllers/sites_controller.rb index 95cf019c..e0453e81 100644 --- a/app/controllers/sites_controller.rb +++ b/app/controllers/sites_controller.rb @@ -58,28 +58,6 @@ class SitesController < ApplicationController end end - # Envía un archivo del directorio público de Jekyll - def send_public_file - @site = find_site - authorize @site - - file = [params[:basename], params[:format]].join('.') - path = File.join(@site.path, 'public', params[:type], file) - path = Pathname.new path - - # TODO: Verificar que no nos estén sacando archivos del sistema, como - # /etc/passwd - # - # En sí el matcher de la ruta no admite .. así que estaríamos semi - # cubiertas. - - if path.exist? - send_file path, 'x-sendfile': true - else - render status: 404 - end - end - def enqueue site = find_site authorize site diff --git a/app/policies/site_policy.rb b/app/policies/site_policy.rb index 8e4aceb1..bf3ac367 100644 --- a/app/policies/site_policy.rb +++ b/app/policies/site_policy.rb @@ -47,10 +47,6 @@ class SitePolicy show? && usuarie? end - def send_public_file? - true - end - def enqueue? build? end