5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 03:41:41 +00:00

eliminar código muerto

This commit is contained in:
f 2019-09-05 15:53:58 -03:00
parent 8400651f50
commit e69a1aceb1
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 0 additions and 26 deletions

View file

@ -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

View file

@ -47,10 +47,6 @@ class SitePolicy
show? && usuarie?
end
def send_public_file?
true
end
def enqueue?
build?
end